Skip to content

Instantly share code, notes, and snippets.

View ger-'s full-sized avatar

Gerard Gaspard ger-

View GitHub Profile
@ger-
ger- / non-square-to-instagram.py
Created December 2, 2013 15:54
A Pythonista script to resize and post either a 3:2 landscape or a portrait image from an iOS device to Instagram. This is a shameless copy of a script from http://macstories.net/.
import clipboard
import Image
import console
import photos
import webbrowser
im=photos.pick_image()
background = Image.new('RGBA', (612,612), (255, 255, 255, 255))
console.clear()
print "Lanscape or Portrait? \n"
@ger-
ger- / 4by4-panel.py
Created December 2, 2013 16:25
Pythonista script to post to Instagram directly from iPhone, a composite of 4 images from camera roll. This is a minor modification to a script from http://macstories.net/.
import clipboard
import Image
import console
import webbrowser
import photos
im1 = clipboard.get_image(idx=0)
im2 = clipboard.get_image(idx=1)
im3 = clipboard.get_image(idx=2)
im4 = clipboard.get_image(idx=3)
@ger-
ger- / chaining-lessn-tweetbot.py
Created December 4, 2013 20:08
chaining-lessn-tweetbot: Clicking this (javascript:window.location='pythonista://chaining-lessn-tweetbot?action=run&argv='+encodeURIComponent(document.location.href);) bookmarklet will launch this pythonista script to grab the webpage url and use Lessn to shorten it and then launch compose dialog of Tweetbot with the shortened url. Note: add you…
import webbrowser
import clipboard
import urllib
import sys
import console
import urllib2
l = sys.argv
link=l[1]
lessn='http://'yourdomain'/'x'/-/?api='API key'&url='
link=urllib.quote(link,safe='')