Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@blech
blech / fetch-vox-post-xml.pl
Last active August 29, 2015 20:44
Fetch a Vox post as XML
#!/usr/bin/perl
use strict;
use warnings;
no warnings 'redefine';
use XML::Atom::Client;
use XML::XPath;
my $username = 'email-address-here';
@blech
blech / flickr-auth-example.pl
Last active August 29, 2015 20:45
Old Flickr auth example in Perl
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use DBI;
use Flickr::API;
use XML::LibXML;
blech@hunter:~/bots/pastebot$ perl pastebot.perl
While loading library [Server::Web]
pastebot.perl Error while loading Server::Web: Can't locate object method "new" via package "POE::Session" at Util/Data.pm line 291.
Compilation failed in require at Server/Web.pm line 20.
BEGIN failed--compilation aborted at Server/Web.pm line 20.
Compilation failed in require at (eval 36) line 1.
BEGIN failed--compilation aborted at (eval 36) line 1.
Please make sure that the following libraries
have been installed:
@blech
blech / music-tunnel
Created February 13, 2009 13:41
SSH tunnel w/Rendezvous
# posted partly as an aide-memoire, but more usefully, as a prompt
# for me to make this into a proper stop-start daemon
# hopefully, one that won't have hardcoded machine names...
IPADDR=`ifconfig en0 | grep 'inet ' | awk '{print $2}' | sed 's/addr://'`
ssh house.husk.org -N -f -L *:3698:foil:3689
dns-sd -P "foil" _daap._tcp. local 3698 foil.local. $IPADDR txtvers=1 "Database ID=BC2C8AD5" "Machine ID=BC2C8AD5" &
@blech
blech / fetch_tumblr.py
Last active August 30, 2015 00:25
A hackish Tumblr backup tool
#!/usr/bin/python
# this script will fetch all your Tumblr posts into a single big JSON file
# TODO- authenticate (fetch private posts)
# TODO- fetch referenced media?
import urllib2
import simplejson as json
start = 0
@blech
blech / fetch_twitter.py
Last active August 30, 2015 00:25
See /blech/mytweets
#!/usr/bin/python
# Incredibly cackhanded Twitter backup. Needs *lots* of work.
import urllib2
import simplejson as json
import base64
page = 1
@blech
blech / flickr-download-set.py
Last active August 30, 2015 01:54
download a set from Flickr
<<<<<<< Updated upstream
#!/usr/bin/python
import flickrapi # http://stuvel.eu/projects/flickrapi
import json as simplejson
import urllib2
api_key = ''
api_secret = ''
photoset_id = ''
@blech
blech / baseconv.py
Created April 13, 2009 13:54
Flickr rev-canonical reverse engineering
"""
Convert numbers from base 10 integers to base X strings and back again.
Sample usage:
>>> base20 = BaseConverter('0123456789abcdefghij')
>>> base20.from_decimal(1234)
'31e'
>>> base20.from_decimal('31e')
1234
@blech
blech / fetch-twitter-posts.py
Created July 22, 2009 06:12
fetch-twitter-posts.py
#!/usr/bin/python
import simplejson as json
import sys
import urllib2
# what site?
top_level_url = "http://twitter.com/"
username = "blech"
password = "notmyrealpassword"
@blech
blech / flickr-sort-gallery.py
Created September 25, 2009 17:05
Sort a Flickr gallery by date