Skip to content

Instantly share code, notes, and snippets.

import urllib, simplejson as json
fp = urllib.urlopen('http://api.twitter.com/1/stevewinton/lists/nizmk/statuses.json')
tweets = json.load(fp)
for tweet in tweets:
print tweet['text']
#!/usr/bin/env python
"""
Have OS X read tweets aloud to you.
"""
# Inspired by this gist: http://gist.github.com/267147
# Uses the Twitter streaming API, and TweetStream (http://bitbucket.org/runeh/tweetstream/src/)
import getopt, getpass, socket, subprocess, sys, tweetstream
#!/usr/bin/env python
"""
Have OS X read tweets aloud to you.
usage:
tweet_speak.py -u <user> [-p <password>] [-f <comma-seperated list of twitter user ids to follow> | -t <comma-seperated list of keywords to track>]
"""
# Inspired by this gist: http://gist.github.com/267147
#!/usr/bin/env python
"""
Have OS X play a song on Spotify via a Twitter request
This work is licensed under the Creative Commons Attribution-Noncommercial 2.0 UK: England & Wales License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.0/uk/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
See: http://www.nixonmcinnes.co.uk/2010/01/07/crowd-sourcing-the-office-stereo-using-twitter-and-spotify/
usage:
#!/usr/bin/env python
import httplib, re, sys
from urllib import urlencode
def get_spotl_url(uri):
"""
Returns a spo.tl URL, given a Spotify track URI
"""
#
#!/bin/bash
#
# Add attachments to Mail.app from the command line
#
open -a Mail.app $@
<h1>Hello, here is an example of using JSONP within a Facebook page</h1>
<p>This is based on the example from the <a href="http://wiki.developers.facebook.com/index.php/FBJS/Examples/Ajax">Ajax examples</a> in the wiki.</p>
<div id="spotlight">
result should load here...
</div>
<script>
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Upload a document of any type to Google Docs from the command line. Requires a Google Apps Premier domain and the Google Data APIs Python client (http://code.google.com/p/gdata-python-client/downloads/list).
Usage:
$ pump_to_gdocs.py -f <file name> -t <mime type>
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Generate an auth_token for access to a hosted Google Docs account using the Google Docs API
See: http://code.google.com/apis/documents/overview.html
"""
import gdata.docs.client
/**
* POST data from a Google Spreadsheet to a remote URL, via menu option Add-ons > Post values
* See: http://www.google.com/google-d-s/scripts/guide.html for more info
*/
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var r = sheet.getRange("B5");
function onOpen() {