etown / go-bot-api

#DOI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GO Bot API

Welcome to the GO Bot API (Great Outdoors Bot) GitHub!

Installation

Software and versions used:

  • Ruby Version Manager (RVM) v1.27.0 (RVM works well with MacOS/Linux but not so well with Windows)

    • RVM works well with MacOS/Linux but not so well with Windows. It is not a strict requirement to develop/run this API

  • Ruby v2.2.4

  • Bundler v1.11.2

  • To obtain remaining gems, run bundle within go-bot-api/

Local Deployment

  1. Create a file named go-bot-api/config/application.yml

Add the following environment variables within the <tt>application.yml</tt> to be used by the API
RIDB_API_KEY
REDIS_URL
GOOGLE_MAPS_API_KEY]
# Forecase.io
WEATHER_API_KEY
# 500px
IMAGE_API_KEY
  1. cd into go-bot-api/

  2. run the command: bin/rails server

By default, this will deploy to port 3000.

To check the status of the API, go to http://localhost:3000/. If GO Bot API is running successfully, you should see {"status":"GO Bot API is Running"}

Available Endpoints

/activities

  • This returns a full list of activity names that are available in RIDB

  • Example response:

{"activities":[{"activity_name":"Auto Touring"},{"activity_name":"Biking"},{"activity_name":"Boating"}, {"activity_name":"Climbing"},{"activity_name":"Historic \u0026 Cultural Site"},{"activity_name":"Camping"}, {"activity_name":"Interpretive Programs"},{"activity_name":"Fishing"},{"activity_name":"Hiking"}, {"activity_name":"Horseback Riding"},{"activity_name":"Hunting"},{"activity_name":"Off Highway Vehicle"}, {"activity_name":"Picnicking"},{"activity_name":"Winter Sports"},{"activity_name":"Recreational Vehicles"}, {"activity_name":"Visitor Center"},{"activity_name":"Water Sports"},{"activity_name":"Wildlife Viewing"}, {"activity_name":"Fish Hatchery"},{"activity_name":"Wilderness"},{"activity_name":"Fire Lookouts/Cabins Overnight"}, {"activity_name":"Fish Viewing Site"},{"activity_name":"Day Use Area"},{"activity_name":"Documentary Site"}, {"activity_name":"Swimming Site"},{"activity_name":"Organization Site Privately Owned"}, {"activity_name":"Organization Site Fs Owned"},{"activity_name":"Playground Park Specialized Sport Site"}, {"activity_name":"Other Recreation Concession Site"},{"activity_name":"Observation Site"}, {"activity_name":"Hotel/Lodge/Resort Fs Owned"},{"activity_name":"Information Site"}, {"activity_name":"Recreation Residence"},{"activity_name":"Snowpark"}, {"activity_name":"Hotel/Lodge/Resort Privately Owned"},{"activity_name":"Environmental Education"}, {"activity_name":"Photography"},{"activity_name":"Paddling"},{"activity_name":"Swimming"},{"activity_name":"Diving"}, {"activity_name":"Snorkeling"},{"activity_name":"Horse Camping"}]}

<tt>/recommendations?activity_name=[activity name]&start_location=&trans_mode=

  • This returns a set of parks that are ordered by shortest travel time

  • Example request:

http://localhost:3000/recommendations?activity_name=hiking&start_location=Washington,D.C.&trans_mode=driving

  • Example response:

{"recareas":[{"id":"2945","name":"Theodore Roosevelt Island","image":"https://drscdn.500px.org/photo/105437305/w%3D280_h%3D280/df9011a1d50680e6320af177b2ec4c17?v=9","distance":"3.1 mi","travel_time":"11 mins","travel_time_seconds":644,"latitude":38.897864,"longitude":-77.0677,"weather":{"summary":"Clear","temperature":59.7}}, {"id":"13972","name":"Peirce Mill","image":"https://drscdn.500px.org/photo/129662297/w%3D280_h%3D280/94b5c179091b85b7b9bcfc0100d88087?v=3","distance":"2.9 mi","travel_time":"14 mins","travel_time_seconds":826,"latitude":38.9401100037,"longitude":-77.051877737,"weather":{"summary":"Clear","temperature":59.61}}, {"id":"2564","name":"Anacostia Park","image":"https://drscdn.500px.org/photo/63688711/w%3D280_h%3D280/f5931b9c2e0e430a871396cf6845e9e7?v=0","distance":"6.1 mi","travel_time":"16 mins","travel_time_seconds":959,"latitude":38.8787169009,"longitude":-76.971174404,"weather":{"summary":"Clear","temperature":59.17}}, {"id":"2690","name":"Fort Dupont Park","image":"https://drscdn.500px.org/photo/34047940/w%3D280_h%3D280/544375ed79173247daedd68d3b27be4f?v=0","distance":"7.2 mi","travel_time":"19 mins","travel_time_seconds":1146,"latitude":38.878556,"longitude":-76.950016,"weather":{"summary":"Clear","temperature":58.9}}, {"id":"13916","name":"Claude Moore Colonial Farm","image":"https://drscdn.500px.org/photo/68110123/w%3D280_h%3D280/a31d8dda44f326ae48aa7286f363d10d?v=0","distance":"9.2 mi","travel_time":"21 mins","travel_time_seconds":1289,"latitude":38.953296,"longitude":-77.152073,"weather":{"summary":"Clear","temperature":59.81}}, {"id":"2789","name":"Kenilworth Park \u0026 Aquatic Gardens","image":"https://drscdn.500px.org/photo/98575361/w%3D280_h%3D280/02699ca5aa115217c2bc21699e935a24?v=13","distance":"6.7 mi","travel_time":"22 mins","travel_time_seconds":1325,"latitude":38.912941888,"longitude":-76.9386660308,"weather":{"summary":"Clear","temperature":59.58}}]}

Opportunities for Growth

  • More social interaction within Social Media

    • Invite Facebook friends to join you on a trip

    • Share a trip

    • Event outreach

  • Utilize transaction data to provide popular destinations based on bookings made around your location

    • This would require improved data management to create the link between the transactions and parks

  • Increased image accuracy

    • Centralized image warehouse would be crucial to the success of image accuracy

  • Learn based on user interaction and build personality profile to accurately provide suggestions

  • Consume more data such as:

    • Demographic information

    • Reasons for satisfaction/dissatisfaction

    • Reasons for content

    • General feedback

    • More data on available parks at all levels of government

  • Provide data analysis to display information such as:

    • Activities most queried in your area, broken down by percentage

    • Demographic analysis per park

About

#DOI

License:MIT License


Languages

Language:Ruby 77.2%Language:HTML 15.6%Language:CSS 4.7%Language:JavaScript 1.5%Language:CoffeeScript 1.0%