stevenheidel / encore-backend

NO LONGER USED - Encore iPhone app API server written in Rails
https://www.crunchbase.com/organization/encore-fm#/entity
1 stars 0 forks source link

Grab tickets redirect #56

Closed slavik112211 closed 10 years ago

slavik112211 commented 11 years ago

Right now when a user clicks to buy tickets on the iPhone app, the backend returns the URL for the last.fm event page. Most of these events have a URL to the ticketer's website in the event in Event.getinfo. We need a quick fix that checks the beginning of the description for a URL. If one is present, return that URL. If not, return the last.fm event page. Although there is a parameter for , Steven found it was not reliable.

slavik112211 commented 11 years ago

Done.

Event.getInfo isn't the only Last.fm web-service call, where the 'tickets_url' should be extracted from. There are additional calls that return this property, such as: geo.getEvents, artist.getEvents. In all of these cases (whenever the event is requested from Last.fm), the event property 'tickets_url' is stored into mongo DB, and exposed to IPhone app through encoreAPI. The following API calls will now return 'tickets_url' as part of their response: Feature Artists API: Combined Search for an Artist's Events, List of artist's past events, List of artist's future events, Return Artist info (returns a couple of events as a showcase) Events API: Past List (if the 'tickets_url' was stored in DB), Today List, Future List

Following my own tests, 'description' field has tickets URLs in only about 20% of events, but nonetheless, 'tickets' field doesn't transmit any data almost all the time.

The URL extraction from 'description' field is smart enough to prefer URLs that contain words such as: ticket, buy, sale, purchase. (It happens that 'description' field contains other URLs as well, for ex., a URL to artist facebook profile).

Unit-tested, cucumber features are updated. Again, vcr fixtures are stored into source tree, to ensure deterministic tests execution in future. Commit: 8cd3803446