Skip to content

Instantly share code, notes, and snippets.

@013
013 / imgur.py
Created November 25, 2012 19:14
Random imgur downloader
#!/usr/bin/python
import sys, urllib, urllib2, random, string
def random_image():
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
rand_img = ''.join(random.choice(chars) for x in range(5))
base = 'http://i.imgur.com/%s.png' % rand_img
return base
@013
013 / gist:2874931
Created June 5, 2012 13:19
Perl-Youtube-Downloader
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my $url = $ARGV[0];
die"URL Needed\n" unless defined $url;
$url =~ /[\?&]v=(.{11})/g;
my $video_id = $1;
my $info_url = "http://www.youtube.com/get_video_info?video_id=" . $video_id;
my $content = get $info_url;