Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Post Code

Name: Anonymous 2011-03-04 21:33

One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.

Name: Anonymous 2011-03-18 12:33

this used to scrape photos
don't know if it works anymore

#!/bin/bash
echo go to 'http://www.facebook.com/profile.php?id=[fb_uid]&sk=photos' and get a tagged photo thumbnail list
echo download it to $PWD/profile.php
echo hit enter
read
echo "<html><body>" > index.html
cat profile.php | \
  sed -e '/data-src/!d;s/title=/\n/g'| \
  perl -pe 's|.*data-src.*(http:.*?)\"><i st.*|\1|' | \
  tr -d '\'| \
  egrep '^ht' | \
  sed 's/photos-./sphotos/;s/_a.jpg/_n.jpg/' | \
  sed 's/\(.*\)/<img src="\1" \/><br \/>/'  \
  >> index.html
echo "</body></html>" >> index.html
echo $PWD/index.html written, open it in your browser

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List