Skip to content

Instantly share code, notes, and snippets.

@ollieglass
Created February 2, 2013 13:22
Embed
What would you like to do?
Open Topsy reports for your last ten Wordpress blog posts. Details at http://ollieglass.com/2013/02/01/topsy-tracker-whos-tweeting-about-your-blog-posts/
import webbrowser
import xmlrpclib
# get posts from wordpress
server = xmlrpclib.ServerProxy('http://ollieglass.com/xmlrpc.php')
result = server.metaWeblog.getRecentPosts('WORDPRESS_BLOG_NAME', 'WORDPRESS_USERNAME', 'WORDPRESS_PASSWORD', 10)
urls = [post['link'] for post in result]
# change into topsy searches
urls = [url.replace('http://', 'http://topsy.com/') for url in urls]
# open all in browser
for url in urls:
webbrowser.open(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment