Skip to content

Instantly share code, notes, and snippets.

@arfon
Created January 21, 2012 12:42
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 arfon/1652675 to your computer and use it in GitHub Desktop.
Save arfon/1652675 to your computer and use it in GitHub Desktop.
Tweet counter
require 'aws-sdk'
AWS_ACCESS_KEY = 'your_aws_access_key'
AWS_SECRET_KEY = 'your_aws_secret_key'
dynamo_db = AWS::DynamoDB.new(:access_key_id => AWS_ACCESS_KEY, :secret_access_key => AWS_SECRET_KEY)
table = dynamo_db.tables['tweets']
# don't forget to load the schema
table.load_schema
loop do
# count the number of items in the table (tweets)
puts table.items.count
sleep 3
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment