-
Notifications
You must be signed in to change notification settings - Fork 1
/
followers.js
78 lines (58 loc) · 2.12 KB
/
followers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import axios from "axios";
import url from 'url';
async function updateTwitterFollowers (){
let username = url.parse(`https://twitter.com/savukku?t=Yys8Abm4FhC96SGBGF_-6g&s=08`).pathname;
console.log(username);
// const options = {
// method: 'GET',
// url: `https://twitter-followers.p.rapidapi.com${username}/profile`,
// headers: {
// 'X-RapidAPI-Key': 'cc73b01c92msh46398dcb32a6a67p15523fjsn3d825ac3e5d8',
// 'X-RapidAPI-Host': 'twitter-followers.p.rapidapi.com'
// }
// };
// await axios.request(options).then(function (response) {
// console.log(response.data.followers);
// }).catch(function (error) {
// console.error(error);
// });
}
async function instagramFollowers(){
let username = url.parse(`https://www.instagram.com/rashiith/`).pathname.replace(/\//g,'');
console.log(username," ", typeof(username));
// const options = {
// method: 'GET',
// url: 'https://instagram-data1.p.rapidapi.com/user/info',
// params: {username: username2},
// headers: {
// 'X-RapidAPI-Key': 'cc73b01c92msh46398dcb32a6a67p15523fjsn3d825ac3e5d8',
// 'X-RapidAPI-Host': 'instagram-data1.p.rapidapi.com'
// }
// };
// await axios.request(options).then(function (response) {
// console.log(response.data.edge_followed_by.count);
// }).catch(function (error) {
// console.error(error);
// });
}
// export default updateTwitterFollowers;
export {
instagramFollowers
}
import axios from "axios";
import url from 'url';
const updateYT =async () => {
let username = url.parse('https://www.youtube.com/c/ThanthitvNews').pathname;
username = username.slice(3,username.length);
console.log(username);
let obj = {};
await axios.get(`https://youtube.googleapis.com/youtube/v3/channels?part=statistics&forUsername=${username}&key=AIzaSyCrOt_umqp0ANXLIHq9RoclicQgVNEOJWg `)
.then(res => {
console.log(`statusCode: ${res.status}`);
console.log(res.data);
})
.catch(error => {
console.error(error);
});
}
export default updateYT;