增加一些说明

This commit is contained in:
zhl 2019-04-02 17:23:02 +08:00
parent e0aaa679f4
commit a67aef9e4f
2 changed files with 19 additions and 4 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# Node版的爬虫工具
## 20190402 玛丽娱乐小程序抓取
sites/hoh8.js

View File

@ -4,6 +4,14 @@ import netUtil from '../utils/net.util';
let client = socketClient;
/**
* 玛丽娱乐 小程序数据爬取工具 主要爬取电影和游戏在run方法中打开或关闭对于代码
* 须从小程序中获取uid和token
*
* */
const token = 'c402cdea067bb6d1ff51090edbe0d645';
const uid = '2407044';
/**
* 获取电影列表
* @param {Number} id 分页 从0开始
@ -43,9 +51,9 @@ const getVideoToken = (id) => {
}
// 更新用户余额
const updateMoney = async (appId, token, appName) => {
const updateMoney = async (appId, videoToken, appName) => {
let url = 'https://game.hoh8.cn/hh/deal/getVideoADReward.anon';
let jsonData = {"appId": appId,"appName":appName,"token":token,"userId":uid};
let jsonData = {"appId": appId,"appName":appName,"token":videoToken,"userId":uid};
let data = {
deviceType: 5,
appVersion: 1,
@ -75,10 +83,10 @@ const parseAllRecord = async (type) => {
let current = 0;
let list = [];
let uid = '2407044';
export default {
run: function () {
let url = `wss://game.hoh8.cn/hh/websocket?userId=${uid}&token=c402cdea067bb6d1ff51090edbe0d645&roomId=0&groupId=global`;
let url = `wss://game.hoh8.cn/hh/websocket?userId=${uid}&token=${token}&roomId=0&groupId=global`;
client.open(url, '');
client.onopen = (e) => {
console.log('socket on open');