Created
March 6, 2009 18:07
-
-
Save segphault/75003 to your computer and use it in GitHub Desktop.
Week in review script using my improved XML-RPC API for MT
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
#!/usr/bin/env python | |
import gconf | |
import myxmlrpc as xmlrpclib | |
RPC_URL = "http://write.arstechnica.com/mt-xmlrpc.cgi" | |
RPC_USER = gconf.Client().get_string("/apps/cms/username") | |
RPC_PASS = gconf.Client().get_string("/apps/cms/password") | |
RPC_BLOG = "1" | |
ARTICLE_URLS = """ | |
<URLS GO HERE> | |
""".strip().split("\n") | |
server = xmlrpclib.ServerProxy(RPC_URL, use_datetime=True) | |
for post in server.mt.getRecentPosts(RPC_BLOG, RPC_USER, RPC_PASS, 500): | |
if any(u == post["link"] for u in ARTICLE_URLS): | |
print '<p><a href="%(link)s"><b>%(title)s</b></a>: %(mt_excerpt)s</p>' % post |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment