p/douban-movies-to-blog/ #155
Replies: 1 comment
-
大家有什么好的想法可以在评论区讨论哦~ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
p/douban-movies-to-blog/
事情的起因是这样的,前几日在看 idealclover 大佬的博客,不经意间看到了他的豆瓣观影记录,他博客中关于豆瓣观影记录是实时同步的,很好奇是如何实现的,经过查看,他是爬取的豆瓣观影界面来实现的,其实关于豆瓣观影记录,网上也有很多的教程,恰巧自己所学的 Go 语言也可以做简单的爬虫实现其效果,于是开始上手造轮子了,PS:了解到非法爬取网站信息是违法的,之前豆瓣 API 接口,关闭访问,在豆瓣上找了好久,终于在我的主页中找到了对于观影记录的官方提供 RSS 订阅,打开订阅,看到有自己所需要的字段,比较好获取,于是就开始了此项目。
分析 首先,需要获取豆瓣提供的 XML 文件,在我的主页右下角就可以看到 RSS 订阅链接:
找到了订阅地址,点击查看 XML 结构,可以看到豆瓣提供的结构还是挺理想的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> <channel> <title>Meng小羽 的收藏</title> <link>https://www.douban.com/people/debuginn/</link> <description> <![CDATA[ Meng小羽 的收藏:想看、在看和看过的书和电影,想听、在听和听过的音乐 ]]> </description> <language>zh-cn</language> <copyright>© 2013, douban.com.</copyright> <pubDate>Sat, 30 May 2020 09:14:08 GMT</pubDate> <item> <title>看过黑衣人:全球追缉</title> <link>http://movie.douban.com/subject/19971676/</link> <description> <![CDATA[ <table><tr> <td width="80px"><a href="https://movie.
https://blog.debuginn.cn/p/douban-movies-to-blog/
Beta Was this translation helpful? Give feedback.
All reactions