Skip to content

pinakes/allyouneedislove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

All You Need Is Love

Start redis server

$ redis-server

Start web server

$ REDISTOGO_URL=redis://localhost:6379 rackup

Start console

$ REDISTOGO_URL=redis://localhost:6379 bundle exec irb -r ./app.rb

Note about files download

To check Filepicker.io API response headers run:

curl -v https://www.filepicker.io/api/file/HXTmWL4VTeHL6jRERQbf?dl=false -o /dev/null

The dl=false param is used to get files without the Content-Disposition header.

Play with Redis in production

Start heroku console

$ heroku console

Require app.rb

require './app.rb'
# => true

List all items in songs (see also: http://redis.io/commands/lrange)

REDIS.lrange 'songs', 0, -1
# => ["https://www.filepicker.io/api/file/wcr8ycSRN2TCUtLtgySd"]

Add an item to songs list (see also: http://redis.io/commands/lpush)

REDIS.lpush 'songs', 'test'
# => 2
REDIS.lrange 'songs', 0, -1
# => ["test", "https://www.filepicker.io/api/file/wcr8ycSRN2TCUtLtgySd"]

Remove all occurrences of test item from songs list (see also: http://redis.io/commands/lrem)

REDIS.lrem 'songs', 0, 'test'
# => 1
REDIS.lrange 'songs', 0, -1
# => ["test", "https://www.filepicker.io/api/file/wcr8ycSRN2TCUtLtgySd"]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published