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
# Generate and use an oauth2 bearer token for the Twitter API in Ruby | |
# | |
# For Application-Only authentication to the twitter API, a 'bearer token' | |
# is required to authenticate agains their endpoints for rate limiting | |
# purposes. | |
# | |
# This script generates a bearer token by posting to twitter and then it | |
# uses that token to poll their API. | |
# | |
# Note, the base 64 encoded consumer credentials for the bearer token needs |
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
require 'rubygems' | |
require 'aws-sdk' | |
# This code snippet sends a push notification to a device using the Amazon SNS service. | |
# | |
# It is using the preview V2 amazon gem as per: | |
# https://aws.amazon.com/sdk-for-ruby/ | |
# | |
# This was installed using: | |
# $ gem install aws-sdk --pre |