Skip to content

自动爬取淘票票<已看电影和自己写的影评>(其中包括自己购过票的和未购票但进行过评分的电影)并更新至Hexo博客

Notifications You must be signed in to change notification settings

kevin4t/taopiaopiao-spider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

taopiaopiao-spider

自动爬取淘票票<已看电影和自己写的影评>(其中包括自己购过票的和未购票但进行过评分的电影)并更新至Hexo博客

效果预览:Tangerinew.

1572141255208

Server

运行于服务器端:

修改get_cookie.py中的账号密码:

def get_init_cookie():
    # 淘宝用户名
    username = 'YourUsername'
    # 淘宝重要参数,从浏览器或抓包工具中复制,可重复使用
    ua = ua = 'YourUa'
    # 加密后的密码,从浏览器或抓包工具中复制,可重复使用
    TPL_password2 = 'YourPassword'
    ul = UsernameLogin(username, ua, TPL_password2)
    ul.login()

登录地址:https://login.taobao.com/member/login.jhtml,可以用于抓包。

在终端运行app.py:

$ python app.py

Client

在Hexo项目文件夹下Source文件夹下新建一个文件夹,名称自定,并将Client内的文件全部放置于其中。

修改index.html中Ajax请求的地址,换成自己的服务器。

function loadMoviesWatched() {
	$.ajax({
		url: 'YourUrl',//替换成你自己的请求地址
		dataType:'json',//服务器返回json格式数据
		type:'get',//HTTP请求类型
		timeout:10000,//超时时间设置为10秒;
		success:function(data){
			...
		}
	})
}

注意:在服务器端需要使用Nginx将443端口反向代理到此进程运行的5000端口。因为与GitPage绑定的Hexo为https协议,其只能向https请求信息,若服务器未绑定域名且未申请证书,则请求失败。

更新Hexo博客

$ hexo g
$ hexo d

About

自动爬取淘票票<已看电影和自己写的影评>(其中包括自己购过票的和未购票但进行过评分的电影)并更新至Hexo博客

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published