PageRenderTime 67ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/keepingtracks.rb

https://bitbucket.org/sea_wolf/keepingtracks-website
Ruby | 62 lines | 56 code | 6 blank | 0 comment | 2 complexity | 1031f18bd7437d42e2ec63c67170d361 MD5 | raw file
  1. require 'sinatra'
  2. configure :production do
  3. require 'newrelic_rpm'
  4. end
  5. set :public_folder, File.dirname(__FILE__) + '/assets'
  6. get '/' do
  7. app_name = "KeepingTracks"
  8. app_about = "Keep track of your rail journeys in the UK, with your Android device."
  9. app_subhead = "is an Android app to help you keep track of your rail journeys."
  10. homepage_path = "https://bitbucket.org/sea_wolf/keepingtracks"
  11. trello_url = "https://trello.com/b/0xS1MOQd"
  12. github_path = "https://github.com/seawolf/KeepingTracks"
  13. download_path = github_path + "/releases"
  14. issues_path = github_path + "/issues"
  15. fdroid_path = "http://f-droid.org"
  16. fdroid_app_path = fdroid_path + "/repository/browse/?fdid=com.seawolfsanctuary.keepingtracks"
  17. fdroid_client_path = ""
  18. irc_path = "http://webchat.freenode.net/?channels=keepingtracks"
  19. erb :index, :locals => {
  20. :app_name => app_name,
  21. :app_about => app_about,
  22. :app_subhead => app_subhead,
  23. :homepage_path => homepage_path,
  24. :trello_url => trello_url,
  25. :download_path => download_path,
  26. :issues_path => issues_path,
  27. :fdroid_path => fdroid_path,
  28. :fdroid_app_path => fdroid_app_path,
  29. :fdroid_client_path => fdroid_client_path,
  30. :irc_path => irc_path
  31. }
  32. end
  33. get '/status' do
  34. Time.now.to_s
  35. end
  36. get '/class_photos/thumbs/:id' do
  37. id = params['id'].to_s.match(/^[0-9\-]*$/)
  38. filename = 'class_photos/thumbs/${id}'
  39. if File.exists?(filename)
  40. send_file(filename)
  41. else
  42. return 404
  43. end
  44. end
  45. get '/class_photos/:id' do
  46. id = params['id'].to_s.match(/^[0-9\-]*$/)
  47. filename = 'class_photos/${id}'
  48. if File.exists?(filename)
  49. send_file(filename)
  50. else
  51. return 404
  52. end
  53. end
  54. get '/app/foursquare/client_id' do "ZPFECAOBGGX5YDDTWSIV3OZ1525OQ3JIRLALI4EXQR5MVCML" end
  55. get '/app/foursquare/client_secret' do "0I1EPOQN2NLY20435XFKJM4CYOR1LVG2ZXA2ET2TUBS53MFV" end
  56. get '/app/foursquare/redirect_uri' do "https://foursquare.com/settings/connections" end