-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript2.js
60 lines (49 loc) · 1.61 KB
/
script2.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
class cDg {
constructor(id) {
this.id = id;
}
view() {
var url = document.getElementById(this.id).src;
const p = url.split("/");
var t = '';
for (let i = 0; i < p.length; i++) {
if(i==2){
t += p[i].replaceAll('-', '--').replaceAll('.','-')+atob('LnRyYW5zbGF0ZS5nb29n')+'/';
} else { if(i != p.length-1){ t += p[i]+'/'; } else { t += p[i]; } }
}
document.getElementById(this.id).src = encodeURI(t);
return encodeURI(t);
}
}
$body = $("body");
$(document).on({
ajaxStart: function () {
$body.addClass("loading");
},
ajaxStop: function () {
$body.removeClass("loading");
},
});
$('.btn').click(function(){
if ($('#username').val() === '') {
alert('Kullanıcı adı giriniz.');
return false;
}
const settings = {
"async": true,
"crossDomain": true,
"url": "https://instagram28.p.rapidapi.com/user_info?user_name="+$('#username').val(),
"method": "GET",
"headers": {
"x-rapidapi-host": "instagram28.p.rapidapi.com",
"x-rapidapi-key": "YOUR-API-KEY"
}
};
$.ajax(settings).done(function (response) {
$('.info').html(`
<img src="${response.data.user.profile_pic_url_hd}.jpg" alt="pp bulunamadı" id="image" width="220" height="220">
<h3 class="h3">@${response.data.user.username}</h3>
<h4 class="h4">${response.data.user.full_name}</h4>`);
let newUri1 = new cDg('image').view();
});
});