Created
January 7, 2015 13:10
-
-
Save christopherdebeer/7ac60de786f76d4735c5 to your computer and use it in GitHub Desktop.
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
fs = require('fs') | |
request = require('request') | |
cheerio = require('cheerio') | |
username = 'barumunk' | |
holdingPage = false | |
count = 0 | |
for page in [0...99] | |
url = "http://ffffound.com/home/#{ username }/found/?offset=#{ page * 25 }&" | |
request url, (error, response, html) -> | |
unless error | |
unless holdingPage | |
holdingPage = cheerio.load( html ) | |
holdingPage( '#content' ).html( holdingPage( '#assets' ) ) | |
holdingPage( '#assets div.asset' ).remove() | |
$ = cheerio.load( html ) | |
assets = $( 'blockquote.asset' ) | |
for item in assets | |
holdingPage( '#assets' ).prepend( item ) | |
holdingPage( '.button' ).remove() | |
else | |
console.error error | |
count++ | |
if count is 77 | |
holdingPage( '.asset' ).css | |
'page-break-inside': 'avoid' | |
console.log( holdingPage('html').html() ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment