aly / netflix.py
0 likes
0 forks
1 files
Last active
A python function to get netflix movie info and parse out all relevant data, returning it in a tuple as stated in the docstring
| 1 | """ |
| 2 | Example usage: |
| 3 | |
| 4 | >>> netflix("60024942") |
| 5 | (u'Catch Me If You Can', u'2002', u'Thu Jan 09 08:00:00 UTC 2003', u'M', u'140 minutes', u'http://cdn2.nflximg.net/images/0432/12050432.jpg', u'An FBI agent makes it his mission to put cunning con man Frank Abagnale Jr. behind bars. But Frank not only eludes capture, he revels in the pursuit.', {u'director': u'Steven Spielberg', u'genre': u'Dramas', u'language': u'English', u'starring': u'Leonardo DiCaprio, Tom Hanks'}) |
| 6 | |
| 7 | ID could be obtained through trivial URL parsing using any stdlib library. |
| 8 | Here, i'll do an example: |
| 9 | |
| 10 | from urlparse import urlparse, parse_qs # urllib.parse in python 3 |
aly / __init__.py
0 likes
0 forks
1 files
Last active
IRC Single Message Bot. Sends a single IRC message to a channel, then quits. Useful for job notifications maybe
| 1 | from irc.bot import ServerSpec |
| 2 | import irc |
| 3 | import sys |
| 4 | import json |
| 5 | |
| 6 | try: |
| 7 | with open('smbotconfig.json') as f: |
| 8 | conf = json.load(f) |
| 9 | except: |
| 10 | print "Error in config or no config found, returning to defaults. Please edit smbotconfig.json (http://jsonlint.com/) and restart the bot" |
aly / ddnsupdate.py
0 likes
0 forks
1 files
Last active
Script to update a DDNS provider (currently namecheap, but any provider that offers a simple http interface should work if the url is replaced) with your current IP
| 1 | import requests,time,socket,json,sys |
| 2 | |
| 3 | def init_settings(): |
| 4 | try: |
| 5 | with open("settings.json") as f: |
| 6 | settings = json.load(f) |
| 7 | return settings |
| 8 | except: |
| 9 | with open("settings.json", "w") as f: |
| 10 | settings = dict(domain="REPLACE_WITH_DOMAIN", |
aly / apache_mirror.py
0 likes
0 forks
2 files
Last active
Script to mirror a directory visible over apache directory indexing. Creates a batch file containing urls and directory output locations
| 1 | #!/usr/bin/env python2 |
| 2 | # Usage: ./apache_mirror.py [BASE URL] [NUMBER OF COLUMNS] |
| 3 | # If the target site has more (or less) than three columns in the directory index, the second parameter is required. |
| 4 | |
| 5 | import sys |
| 6 | import urllib2 |
| 7 | from bs4 import BeautifulSoup as Soup |
| 8 | |
| 9 | def do_iterate(curdir="", BASE="", COL="", fh=None): |
| 10 | print "Entering {}".format(BASE + curdir) |
aly / gpstrack.php
0 likes
0 forks
1 files
Last active
Google Maps display for a csv-formatted list of dates/latitudes/longitudes/accuracy-in-metres.
| 1 | <?php |
| 2 | |
| 3 | $passwdfile = "/path/to/file"; |
| 4 | $logpath = "/path/to/file"; // should be a csv file with date,lat,long,hor-acc |
| 5 | |
| 6 | // For json |
| 7 | foreach (apache_request_headers() as $header => $value) { if ($header == "Accept") { $accept = $value; } } |
| 8 | |
| 9 | // Variable checks |
| 10 | $allowed = isset($_GET['allowed']); |
aly / gistfile1.md
0 likes
0 forks
1 files
Last active
(bookmarklet) Cheat at http://game.ioxapp.com/color/ (for people with bad eyesight or bad screens)
javascript:(function%20()%20{prev="";var%20arr=[].slice.call(document.getElementsByTagName('span')).slice(3);for(i=0;i<arr.length;i++){if(arr[i].style){if(prev!=arr[i].style["backgroundColor"]&&prev!=""){arr[i].style["backgroundColor"]%20=%20"rgb(255,%20255,%20255)";}else{prev%20=%20arr[i].style["backgroundColor"];}}}})()
