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
// ==UserScript==
// @name Endless Summer on dsbd
// @namespace http://www.tumblr.com/
// @description random next link on tumblr dashboard
// @include http://www.tumblr.com/dashboard/1*
// @require http://gist.github.com/raw/3242/9dc0cdee5e975d275c7ab71f581d272eb316674f/dollarX.js
// @version 0.0.3.5
// ==/UserScript==
// requires AutoPagerize http://userscripts.org/scripts/show/8551 by swdyh
// using utility $X() http://gist.github.com/3242 by os0x
// notice: put this script ABOVE AutoPagerize
// endlesSummeRize fire on http://www.tumblr.com/dashboard/11, http://www.tumblr.com/dashboard/1111, http://www.tumblr.com/dashboard/1111111111111111111
 
(function(){
var url = 'http://www.tumblr.com/dashboard';
function getId(url){
  var opt = {
    method: 'GET',
    url: url,
    headers : {
    },
    onload: function(res) {
      var d = document.createElement("div");
      d.innerHTML = res.responseText;
      var i = $X('.//ol[@id="posts"]/li[@id]', d);
      if(i.length) {
        i = i[0];
      } else return;
      GM_setValue('postno', i.id.match(/post([\d]+)/)[1].toString());
    },
  }
  GM_xmlhttpRequest(opt);
}
 
function endlessSummer(doc, url, info){
  var content_element = $X('id("posts")', doc)[0];
  content_element.className = 'autopagerize_page_element';
  var a = $X('id("pagination")/a[last()]',doc);
  if (a.length) a = a[0];
  else return;
  a.href = 'http://www.tumblr.com/dashboard/1000/' + Math.floor(Math.random() * GM_getValue('postno', ' 83297833'));
  a.className = 'autopagerize_nextlink';
  a.rel = 'next';
}
 
getId(url);
endlessSummer(document, '', '');
 
setTimeout(function(){
  if (window.AutoPagerize && window.AutoPagerize.addDocumentFilter)
window.AutoPagerize.addDocumentFilter(endlessSummer);
},0);
})();