taizooo (owner)

Revisions

gist: 26170 Download_button fork
public
Description:
Endless Summer on Tumblr Dashboard
Public Clone URL: git://gist.github.com/26170.git
Embed All Files: show embed
Endless_Summer_on_dsbd.user.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
// ==UserScript==
// @name Endless Summer on dsbd
// @namespace http://www.tumblr.com/
// @description random next link on tumblr dashboard
// @include http://www.tumblr.com/dashboard/1000
// @include http://www.tumblr.com/show/*/1000
// @require http://gist.github.com/3242.txt
// @require http://gist.github.com/198443.txt
// @version 0.0.3.9.9.9.9.9.9.9.9.9
// ==/UserScript==
// requires AutoPagerize http://userscripts.org/scripts/show/8551 by swdyh
// using $X() http://gist.github.com/3242 by os0x
// using createDocumentFromString http://gist.github.com/198443 by os0x
// notice: put this script ABOVE AutoPagerize
// endlesSummeRize fire on http://www.tumblr.com/dashboard/1000 or http://www.tumblr.com/show/photos/by/everyone/1000 or ...
 
(function(){
var dsbd = 'http://www.tumblr.com/dashboard';
var siteinfo = {};
siteinfo.nextLink = 'id("next_page_link")/self::a';
 
function getId(info){
  var opt = {
    method: 'GET',
    url: dsbd,
    headers : {
    },
    onload: function(res) {
      var d = createDocumentFromString(res.responseText);
      var i = $X(info.nextLink, d);
      if(i.length){
        i = i[0];
      } else return;
      GM_setValue('postno', i.href.match(/.*\/\d+\/(\d+)/)[1].toString());
    },
  }
  GM_xmlhttpRequest(opt);
}
 
function endlessSummer(doc, url, info){
  var a = $X(info.nextLink, doc);
  if (a.length){
a = a[0];
} else return;
  a.href = location.pathname + '?offset=' + Math.floor(Math.random() * GM_getValue('postno', 377777777));
  a.textContent = 'Searching for The Endless Summer \u2192 ';
  a.style.background='none repeat scroll 0 0 #4AADF0'
}
 
getId(siteinfo);
endlessSummer(document, location.href, siteinfo);
 
setTimeout(function(){
  if (window.AutoPagerize && window.AutoPagerize.addDocumentFilter)
window.AutoPagerize.addDocumentFilter(endlessSummer);
},0);
})();