Created
September 20, 2012 11:36
-
-
Save poochin/3755407 to your computer and use it in GitHub Desktop.
Dashboard を特定の post id になるまで掘り下げるブックマークレット(未入力時に自分の最新ポストまで遡るようにしました)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: void function() { | |
| var post_id; | |
| post_id = parseInt(prompt('input post id to fall in.')); | |
| new PeriodicalExecuter(function FallInDashboard(pe) { | |
| var posts = $$('#posts > li.post:not(.new_post)'); | |
| exit: { | |
| if (isNaN(post_id)) { | |
| if ($$('.is_mine:not(.new_post)').length) { | |
| break exit; | |
| } | |
| } | |
| else if (parseInt(posts.slice(-1)[0].id.slice(5)) <= post_id) { | |
| break exit; | |
| } | |
| if (loading_next_page == false) { | |
| loading_next_page = true; | |
| retry_auto_paginator_request(); | |
| } | |
| return; | |
| } | |
| next_page = null; | |
| pe.stop(); | |
| alert('Finished!!'); | |
| }, 1); | |
| }() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment