Skip to content

Instantly share code, notes, and snippets.

@adamjonas
Last active December 24, 2015 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamjonas/6731117 to your computer and use it in GitHub Desktop.
Save adamjonas/6731117 to your computer and use it in GitHub Desktop.
Pergola
###cURL
#Authenticate
curl -X POST --data 'username=adam.jonas@carrotcreative.com&password=1password' https://api.vineapp.com/users/authenticate
#My profile
curl -H "vine-session-id:#{key}" https://api.vineapp.com/users/me
###httparty
gem install httparty
require 'httparty'
#httparty authenticate
reponse = HTTParty.post('https://api.vineapp.com/users/authenticate', body: { username: "adam.jonas@carrotcreative.com", password: "1password"})
# Get /user
HTTParty.get('https://api.vineapp.com/users/profiles/908940759363887104', :headers => {"vine-session-id" => response["data"]["key"]})
# Get Popular
HTTParty.get('https://api.vineapp.com/timelines/popular', :headers => {"vine-session-id" => response["data"]["key"]})
# Get a user timeline
HTTParty.get('https://api.vineapp.com/timelines/users/956062410865807360', :headers => {"vine-session-id" => response["data"]["key"]})
###Pergola
gem install pergola
require 'pergola'
#authenticate
client = Pergola::Client.new(:username => "adam.jonas@carrotcreative.com", :password => "1password")
###Sinatra Code
https://github.com/carrot/pergola-sinatra
#App on the interwebs
http://pergola.herokuapp.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment