aly / lfm_getlyrics.py
0 likes
0 forks
1 files
Last active
Opens a webbrowser with the azlyrics page for the now-playing song
| 1 | import pylast, webbrowser, re, sys |
| 2 | |
| 3 | key = "9eefecb15b3891540eb66748f37bf539" |
| 4 | use = sys.argv[1] if len(sys.argv) > 1 else "blha303" |
| 5 | |
| 6 | def strip(string): |
| 7 | return re.sub(r'[\W_]+', '', string.replace("&", " and ")) |
| 8 | |
| 9 | lfm = pylast.LastFMNetwork(api_key=key, username=use) |
| 10 | track = lfm.get_user(use).get_now_playing() |
aly / config.php
0 likes
0 forks
3 files
Last active
Multiple server support for github.com/delan/lookout http://stats.blha303.biz
| 1 | <?php |
| 2 | $servers = array("http://stats.home.blha303.biz", "http://stats.web.blha303.biz", "http://stats.ipv6.b303.me", "http://stats.irc.b303.me"); |
aly / get-billboard.py
0 likes
0 forks
1 files
Last active
Returns a list of tuples for each item in a specified Billboard Top 100 list. Planning a Arch Rollback Machine-style repository for popular music
| 1 | #!/usr/bin/env python2 |
| 2 | from bs4 import BeautifulSoup as Soup |
| 3 | import requests |
| 4 | from collections import namedtuple |
| 5 | from datetime import datetime, timedelta |
| 6 | |
| 7 | Song = namedtuple('Song', ['title', 'artist', 'position', 'spotify', 'vevo', 'rdio']) |
| 8 | |
| 9 | def billboard(date): |
| 10 | soup = Soup(requests.get("http://www.billboard.com/charts/hot-100/%s" % date).text) |
aly / ytPlaylistToPodcast.py
0 likes
0 forks
1 files
Last active
Generates an iTunes compatible podcast from a Youtube playlist, storing the audio files in a local directory. Could be adapted to store the files in Dropbox or on another media provider if desired | Requires python 2.7, requests, wget, and youtube-dl | Configuration at top of file
| 1 | #!/usr/bin/env python2 |
| 2 | # This file is released as public domain by Steven Smith (blha303) in Apr 2015 |
| 3 | # In areas where public domain isn't a thing, I release it under the MIT license. |
| 4 | # Although credit would be nice if you use this in something cool. And email me a link too pls. |
| 5 | import time,os,requests,json,subprocess |
| 6 | from urllib import urlretrieve |
| 7 | |
| 8 | DTFORMAT = "%a, %b %d %Y %H:%M:%S +0000" # Do not modify, needs to be at top |
| 9 | |
| 10 | playlisturl = "https://www.youtube.com/playlist?list=UU9CuvdOVfMPvKCiwdGKL3cQ" |
aly / gistfile1.txt
0 likes
0 forks
1 files
Last active
netctl config for polytechnic west (australia) wifi (needs student ID and password) | modified https://aur.archlinux.org/packages/netctl-eduroam/
| 1 | Connection='wireless' |
| 2 | Interface=wlp2s0 # or your wireless interface name |
| 3 | Security='wpa-configsection' |
| 4 | Description='tafe' |
| 5 | IP='dhcp' |
| 6 | TimeoutWPA=30 |
| 7 | WPAConfigSection=( |
| 8 | 'ssid="PWAStudent"' |
| 9 | 'key_mgmt=WPA-EAP' |
| 10 | 'eap=PEAP' |
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" |