Skip to content

Instantly share code, notes, and snippets.

@dragonly
Created October 21, 2015 15:12
Show Gist options
  • Save dragonly/18a6e392170de55a91e6 to your computer and use it in GitHub Desktop.
Save dragonly/18a6e392170de55a91e6 to your computer and use it in GitHub Desktop.
py
import requests
import xml.etree.ElementTree as ET
import xmltodict
import pprint
import json
url_base = 'http://bbs.fudan.edu.cn/bbs/rss?bid=%s'
board_range = range(1,299)
channels = []
for board in board_range[:1]:
channel = {}
url = url_base % board
xml = requests.get(url).content
data = xmltodict.parse(xml)
channel = data['rss']['channel']
items = channel['item']
pprint.pprint(json.dumps(items))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment