Created
March 31, 2017 16:01
-
-
Save ryo-n/a7285873a2f8675c5ccaab0d929a587c to your computer and use it in GitHub Desktop.
bitbar hatebu hotentry plugin
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 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