Created
June 4, 2018 17:08
-
-
Save belonesox/a220350469102ec58b30164d8f10625a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def publish_something_new(self): | |
self.load_published_urls() | |
lastlinks = self.site.allpages(prefix='201', start='20180301', namespace=0, limit=500, filterredir='redirects') | |
for link in lastlinks: | |
OK = True | |
url = u"http://0x1.tv/" + link.name | |
if url not in self.published_urls: | |
video_page = link.redirects_to() | |
for cat_ in video_page.categories(): | |
if cat_.name.endswith(":Draft"): | |
OK = False | |
break | |
if OK: | |
res = self.graph.post("/0x1.tv/feed", retry=3, link=url) #, message=message_) | |
self.refresh_link_to_facebook(link.name, res["id"]) | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment