Try using Python's feedparser.

This is a memo for myself.

(Don't worry about the feed you're getting)

skeameba = feedparser.parse('http://rssblog.ameba.jp/ske48official/rss.html')

At this rate, Japanese is escaped

In [21]: skeameba['entries'][0]['title']
u'(\u5927\u77e2\u771f\u90a3)\u6709\u540d\u306a\u306e\u304b\u306a'

That's why Japanese display

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)

Then it looks like this.

for entry in skeameba['entries']:
    title = entry['title']
    link = entry['link']
    print "title:", pp(title)    print "link: " , link
title: u'(Masana Oya)Is it famous'
link:  http://ameblo.jp/ske48official/entry-11442256228.html
title: u'Churi =(((O ゜ ◇ ゜)o {Enjoy camera girls in 2013 ~!!!'
link:  http://ameblo.jp/ske48official/entry-11442248464.html
title: u'First visit. (Flowers, з,) ~ ♪'
link:  http://ameblo.jp/ske48official/entry-11442205471.html
title: u'Orange juice and rice balls(・ ∀ ・ >)'
link:  http://ameblo.jp/ske48official/entry-11442174092.html
title: u'Furukawa(゜ ∀.*)Pochi'
link:  http://ameblo.jp/ske48official/entry-11442139096.html
title: u'Oihi ~ * ♪(゜ ゜ summer)'
link:  http://ameblo.jp/ske48official/entry-11442056727.html
title: u'Ogiso(・*・ A hideaway.)3 Shiori'
link:  http://ameblo.jp/ske48official/entry-11442023303.html
title: u'Qin * At that moment'
link:  http://ameblo.jp/ske48official/entry-11441959773.html
title: u'☆ Happy new year!!★KUMI'
link:  http://ameblo.jp/ske48official/entry-11441813459.html
title: u'Lena(Hatsumode ・ ω ・ san)'
link:  http://ameblo.jp/ske48official/entry-11441713875.html

Recommended Posts

Try using Python's feedparser.
Try using Python's Tkinter
Try using Python's networkx with AtCoder
Try using docker-py
Try using cookiecutter
Try using PDFMiner
Try using Selenium
Try using scipy
Try using pandas.DataFrame
Try using django-swiftbrowser
Try using matplotlib
Try using tf.metrics
Try using PyODE
Try using the camera with Python's OpenCV
[Azure] Try using Azure Functions
Try using virtualenv now
Try using W & B
Try using Django templates.html
[Kaggle] Try using LGBM
Try using Tweepy [Python2.7]
Try using Pytorch's collate_fn
Try using PythonTex with Texpad.
[Python] Try using Tkinter's canvas
Try using Jupyter's Docker image
Try using scikit-learn (1) --K-means clustering
Try function optimization using Hyperopt
Try using matplotlib with PyCharm
Try using Azure Logic Apps
Try using Kubernetes Client -Python-
[Kaggle] Try using xg boost
Try using the Twitter API
Try using OpenCV on Windows
Try using Jupyter Notebook dynamically
Try using AWS SageMaker Studio
Try tweeting automatically using Selenium.
Try using SQLAlchemy + MySQL (Part 1)
Try using the Twitter API
Try using SQLAlchemy + MySQL (Part 2)
Try using Django's template feature
Try using the PeeringDB 2.0 API
Try using Pelican's draft feature
Send email using Python's smtplib
Try using pytest-Overview and Samples-
Try using folium with anaconda
Try using Janus gateway's Admin API
[Statistics] [R] Try using quantile regression.
Try using Spyder included in Anaconda
Try using design patterns (exporter edition)
Try using Pillow on iPython (Part 1)
Try using Pillow on iPython (Part 2)
Try using Pleasant's API (python / FastAPI)
Try using LevelDB in Python (plyvel)
Try using pynag to configure Nagios
Try using PyCharm's remote debugging feature
Try using ArUco on Raspberry Pi
Try using cheap LiDAR (Camsense X1)
[Sakura rental server] Try using flask.
Try to operate the database using Python's ORM Peewee (August 2019 version)
Try using Pillow on iPython (Part 3)
Reinforcement learning 8 Try using Chainer UI
Try to get statistics using e-Stat