An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
import os | |
from PIL import Image | |
def extractFrames(inGif, outFolder): | |
frame = Image.open(inGif) | |
nframes = 0 | |
while frame: | |
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
nframes += 1 |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
import os | |
from PIL import Image | |
''' | |
I searched high and low for solutions to the "extract animated GIF frames in Python" | |
problem, and after much trial and error came up with the following solution based | |
on several partial examples around the web (mostly Stack Overflow). | |
There are two pitfalls that aren't often mentioned when dealing with animated GIFs - |
#Reporter Save File Schema
##The Reporter Export File
Reporter saves to your Dropbox account with plaintext JSON files, one for each day. When a Report is entered in the app a file is created for that day if it does not exist. Otherwise, the report is appended to the existing file. The save folder is located in 'Dropbox/Apps/Reporter-App/'.
Reporter save files are named according to the following convention:
YYYY-MM-DD-reporter-export.json
#! /usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import json | |
import httplib2 | |
from datetime import datetime | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2WebServerFlow |
# From https://github.com/wnyc/PIL/blob/master/Scripts/gifmaker.py | |
# | |
# The Python Imaging Library | |
# $Id$ | |
# | |
# convert sequence format to GIF animation | |
# | |
# history: | |
# 97-01-03 fl created | |
# |
/* | |
npm install dom-anchor-text-quote | |
npm install dom-seek | |
npm install jquery | |
npm install xpath-range | |
browserify anchor.js -o anchor-bundle.js | |
*/ | |
/* |
<? | |
///////////////////// | |
// slack2html | |
// by @levelsio | |
///////////////////// | |
// | |
///////////////////// | |
// WHAT DOES THIS DO? | |
///////////////////// | |
// |
[{ | |
"lat": "40.79142677512476", | |
"lng": "-73.93807411193848", | |
"name": "1 Ave @ 110 St", | |
"camera": "http://207.251.86.238/cctv261.jpg" | |
}, { | |
"lat": "40.800426144169315", | |
"lng": "-73.93155097961426", | |
"name": "1 Ave @ 124 St", | |
"camera": "http://207.251.86.238/cctv254.jpg" |
FROM python:3.5 | |
WORKDIR /app | |
COPY requirements.txt /app/ | |
RUN pip install -r requirements.txt | |
COPY . /app/ | |
CMD python bot.py |