Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

GET /photo returns a random camera, GET /photo.json returns all #79

Merged
merged 6 commits into from Feb 5, 2013

Conversation

sshirokov
Copy link
Member

GET /photo.json returns JSON with URLs to photos from all attached cameras:

As in: (I only have one camera in this machine)

{
  "images": [
    "http://localhost:9393/snap_1_1357951597.jpg"
  ]
}

Goals

  • Redirect to random camera on GET /photo
  • Return all photos in JSON
  • Hubot integration

cc/ @skalnik

@@ -28,6 +28,16 @@ class App < Sinatra::Base
end

helpers do
def imagesnap
imagesnap = File.join(APP_ROOT, 'vendor', 'imagesnap', 'imagesnap')
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make this a constant?

@sshirokov
Copy link
Member Author

@skalnik: Factored out the entire /photo* route set to app/photo.rb, which does, in fact move imagesnap to a constant.

@skalnik
Copy link
Member

skalnik commented Jan 12, 2013

👍 once we have Hubot Integration

@skalnik
Copy link
Member

skalnik commented Feb 4, 2013

Hubot integration happening! github/hubot-scripts#751

skalnik added a commit that referenced this pull request Feb 5, 2013
GET /photo returns a random camera, GET /photo.json returns all
@skalnik skalnik merged commit 02dd8ec into master Feb 5, 2013
@skalnik skalnik deleted the all-the-photos branch February 5, 2013 00:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants