Ceci est mon propre mémo.
(Ne vous inquiétez pas du flux que vous recevez)
skeameba = feedparser.parse('http://rssblog.ameba.jp/ske48official/rss.html')
À ce rythme, le japonais est échappé
In [21]: skeameba['entries'][0]['title']
u'(\u5927\u77e2\u771f\u90a3)\u6709\u540d\u306a\u306e\u304b\u306a'
C'est pourquoi l'affichage japonais
def pp(obj):
pp = pprint.PrettyPrinter(indent=4, width=160)
str = pp.pformat(obj)
return re.sub(r"\\u([0-9a-f]{4})", lambda x unichr(int ("0x" + x.group(1), 16)), str)
Alors ça ressemble à ça.
for entry in skeameba['entries']:
title = entry['title']
link = entry['link']
print "title:", pp(title) print "link: " , link
title: u'(Mana Oya)Est-ce célèbre'
link: http://ameblo.jp/ske48official/entry-11442256228.html
title: u'Churi =(((O ゜ ◇ ゜)o {Profitez des filles de la caméra en 2013 ~!!!'
link: http://ameblo.jp/ske48official/entry-11442248464.html
title: u'Première visite. (Fleurs, з,) ~ ♪'
link: http://ameblo.jp/ske48official/entry-11442205471.html
title: u'Jus d'orange et boulettes de riz(・ ∀ ・ >)'
link: http://ameblo.jp/ske48official/entry-11442174092.html
title: u'Furukawa(゜ ∀.*)Pochi'
link: http://ameblo.jp/ske48official/entry-11442139096.html
title: u'Oihi ~ * ♪(゜ ゜ été)'
link: http://ameblo.jp/ske48official/entry-11442056727.html
title: u'Ogiso(・*・ Un refuge.)3 Shiori'
link: http://ameblo.jp/ske48official/entry-11442023303.html
title: u'Hata * À ce moment'
link: http://ameblo.jp/ske48official/entry-11441959773.html
title: u'☆ Bonne année!!★KUMI'
link: http://ameblo.jp/ske48official/entry-11441813459.html
title: u'Lena(Première visite ・ ω ・ san)'
link: http://ameblo.jp/ske48official/entry-11441713875.html
Recommended Posts