Skip to content

Instantly share code, notes, and snippets.

@ryo-n
Created March 31, 2017 16:01
Show Gist options
  • Save ryo-n/a7285873a2f8675c5ccaab0d929a587c to your computer and use it in GitHub Desktop.
Save ryo-n/a7285873a2f8675c5ccaab0d929a587c to your computer and use it in GitHub Desktop.
bitbar hatebu hotentry plugin
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import io
import feedparser
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
url = 'http://feeds.feedburner.com/hatena/b/hotentry'
rss = feedparser.parse(url)
print("hatebu")
print("---")
for entry in rss["entries"]:
print(entry["hatena_bookmarkcount"] + " users " + entry["title"] + "| color=black href=" + entry["link"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment