This file contains hidden or 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
| // This code accompanies a blog post: http://chris.eidhof.nl/posts/json-parsing-in-swift.html | |
| // | |
| // As of Beta5, the >>= operator is already defined, so I changed it to >>>= | |
| import Foundation | |
| let parsedJSON : [String:AnyObject] = [ | |
| "stat": "ok", | |
| "blogs": [ |
This file contains hidden or 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
| require 'hmac-sha1' | |
| require 'uri' | |
| require 'base64' | |
| def urlsafe_base64_encode(content) | |
| Base64.encode64(content).strip.gsub('+', '-').gsub('/','_').gsub(/\r?\n/, '') | |
| end | |
| def generate_access_token(access_key, secret_key, url, body) | |
| uri = URI.parse(url) |