Archived
1
0
Fork 0

remove golem article fetching

This commit is contained in:
Lukas Winkler 2018-01-03 22:44:58 +01:00
parent c21255921d
commit e2fdcaf877
2 changed files with 2 additions and 23 deletions

View file

@ -1,10 +0,0 @@
from bs4 import BeautifulSoup
import requests
def get_top_articles():
r = requests.get("https://www.golem.de/")
s = BeautifulSoup(r.text, "html.parser")
return [a["href"] for a in s.find(id=["recent-articles"]).find_all("a")[:2]]

15
main.py
View file

@ -1,14 +1,13 @@
import logging
import sys
from time import mktime
import feedparser
import sys
import logging
import yaml
from raven import Client
from wallabag_api.wallabag import Wallabag
import github_stars
import golem_top
logger = logging.getLogger()
logger.handlers = []
@ -88,16 +87,6 @@ for sitetitle, site in sites.items():
if f.entries:
sites[sitetitle]["latest_article"] = f.entries[0].title
# articles = golem_top.get_top_articles()
# params = {
# 'access_token': wall.token,
# "urls[]": articles
# }
# response = wall.query("/api/entries/exists.{format}".format(format=wall.format), "get", **params)
# for url, old in response.items():
# if not old:
# wall.post_entries(url=url, tags="golem,it", title=None)
# print(response)
with open("sites.yaml", 'w') as stream:
yaml.dump(sites, stream, default_flow_style=False)