javascript - Automate populating fields in rails from one link -


so i'm working on links. have list of events, have 1 link inside looks this,

provider1.co.uk/event/1f004cc6c1fa8142 

not go on know, if called provider 1's api, can access date, venue name, location, etc.

now haven't set yet, i'm wanting js script load api. (which have elsewhere).

now sidetrack little heres provider twos link.

provider2.com/buy-(name-of-event)-tickets/(venue-name)-tickets/(date-of-event)/perf/1028576 

and provider 3's

provider3.com/(event-name)-tickets-(event-name)-(location-name)-(venue-name)-(date-of-event)/event/9277843/ 

now how stands @ moment enter these text boxes manually.

we'd @ making automatic, provider1 automated. want other 2 providers automatically filled inputboxes on page load. thats it, sounds simple i'm not 100% sure :)

sam

heres json response provider 1 way

"venue": {         "venueid": 10191,         "name": "venue name",         "street": "location street",         "city": "location name",        }  "eventid": 2176597,       "status": "onsale",       "name": "event name",       "eventdate": "2016-06-22 17:00:00" 

i'm using rails, might easier if can make api call in rails rather javascript.

so i'm using httparty,

response = httparty.get('url') json = json.parse(response.body) 

i have called json byebug, , throws need, if put json.eventid doesnt work?

heres response

{"details"=>{"totalresults"=>1, "totalpages"=>1, "currentpage"=>1, "resultsperpage"=>50}, "results"=>[{"eventid"=>2176597}]} 

however eventid apparently null


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -