This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AFNetworking | |
class InstagramQuerier: NSObject { | |
static let sharedQuerier = InstagramQuerier() | |
private let manager : AFHTTPRequestOperationManager = AFHTTPRequestOperationManager() | |
func fetchFollowers(account: Account, count: Int = -1, completion: (Bool, [User]) -> (Void)) { | |
let params = "/users/\(account.userId)/followed-by|access_token=\(account.accessToken)" | |
let sig = HMAC.signWithKey(UserSettings.InstagramClientSecret(), usingData: params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UserInteractionFetcher.swift | |
// Instagrowth | |
// | |
// Created by Zachary Shakked on 1/17/16. | |
// Copyright © 2016 Zachary Shakked. All rights reserved. | |
// | |
import UIKit | |
import AFNetworking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"author":"Albert Einstein", | |
"quote":"You can't blame gravity for falling in love." | |
}, | |
{ | |
"author":"Alexander Smith", | |
"quote":"Love is but the discovery of ourselves in others, and the delight in the recognition." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"author":"Abraham Lincoln", | |
"quote":"If there is anything that a man can do well, I say let him do it. Give him a chance." | |
}, | |
{ | |
"author":"Adam Smith", | |
"quote":"It is not from the benevolence of the butcher, the brewer, or the baker that we expect our dinner, but from their regard to their own interest." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"author":"Abraham Lincoln", | |
"quote":"No man has a good enough memory to be a successful liar." | |
}, | |
{ | |
"author":"Albert Einstein", | |
"quote":"When you are courting a nice girl an hour seems like a second. When you sit on a red-hot cinder a second seems like an hour. That's relativity." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"author": "Abraham Lincoln", | |
"quote": "Things may come to those who wait, but only the things left by those who hustle.", | |
"image": "http://upload.wikimedia.org/wikipedia/commons/1/1b/Abraham_Lincoln_November_1863.jpg" | |
}, | |
{ | |
"author": "Adam Smith", | |
"quote": "The great secret of education is to direct vanity to proper objects.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"artist":"2 Pac", | |
"lyric":"Even the genius asks questions." | |
}, | |
{ | |
"artist":"Alanis Morissette", | |
"lyric":"When pain brings you down, don't be silly, don't close your eyes and cry, you just might be in the best position to see the sun shine." | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Instagram = require('instagram-node').instagram({port : process.env.PORT || 443, enforce_signed_requests : true}); | |
var Datapoint = require('./datapoint.js'); | |
var CronJob = require('cron').CronJob; | |
// Every call to `ig.use()` overrides the `client_id/client_secret` | |
// or `access_token` previously entered if they exist. | |
Instagram.use({ access_token: '215615213.156af3d.fccd9a4872aa42738ea71a649f365a85' }); | |
Instagram.use({ client_id: '156af3d753824c2aba64eb83ab10f53d', client_secret: '809b9a46b5e94817b1a65ae3069370a1' }); | |
var Parse = require('parse/node').Parse; | |
Parse.initialize("OfPZoW3GA3aKIgT61enhVaNydnEvICdH9GCReAKM", "fPByJ4b9CmVbLBC9jQZhjqlswhVTNchnStLwGZVe"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func follow(account: Account, user: User, completion : (Bool) -> (Void)) { | |
let urlString = "https://api.instagram.com/v1/users/\(user.id)/relationship?access_token=\(account.accessToken)" | |
let parameters = ["action" : "follow"] | |
let jsonSerialization = try! NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions.PrettyPrinted) | |
let json = String(data: jsonSerialization, encoding: NSUTF8StringEncoding)! | |
let dict = ["body" : json] | |
manager.responseSerializer = AFJSONResponseSerializer() | |
manager.POST(urlString, parameters: dict, success: { (operation, result) -> Void in | |
let result = result as! NSDictionary | |
let data = result["data"] as! NSDictionary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// Programming Assingment 4 - Water Jugs | |
// | |
// Created by Zachary Shakked on 10/21/15. | |
// Copyright © 2015 Zachary Shakked. All rights reserved. | |
// | |
#include <iostream> | |
#include <vector> |