-
Notifications
You must be signed in to change notification settings - Fork 0
/
who_to_follow.php
52 lines (52 loc) · 1.28 KB
/
who_to_follow.php
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
<?php include ('header.php'); ?>
<main id="main">
<div class="article_wrap">
<aside class="left_column">
<?php include dirname(__FILE__).('/widgets/side_current_user.php'); ?>
<?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
</aside>
<article class="center_column">
<div id="js-follows_profile">
</div>
<footer id="js-follows_footer">
<i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
</footer>
</article>
</div>
</main>
<script>
$('title').text('Halcyon / Who to follow');
var wtfprofiles = JSON.parse(localStorage.who_to_follow);
var pcount = 0;
var isSyncing = false;
function nextprofiles(displayed) {
if(wtfprofiles.length - displayed < 30) {
fcount = wtfprofiles.length;
}
else {
fcount = 30;
}
for(i=0;i<fcount;i++) {
if(current_following_accts.indexOf(wtfprofiles[displayed+i]) == -1) {
api.get('search',[{name:'q',data:"@"+wtfprofiles[displayed+i]},{name:'resolve',data:'true'}], function(search) {
follows_template(search.accounts[0]).appendTo("#js-follows_profile");
replace_emoji();
if(i = 29) {
isSyncing = false;
}
});
}
}
}
nextprofiles(0);
$(window).scroll(function () {
if($(window).scrollTop()+window.innerHeight >= $(document).height()-700) {
if(!isSyncing) {
isSyncing = true;
pcount++;
nextprofiles(pcount*30);
}
}
});
</script>
<?php include ('footer.php'); ?>