Last active
August 29, 2015 14:15
-
-
Save silmood/cb0481bff2f36ba73501 to your computer and use it in GitHub Desktop.
Contract for Eventful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static final String BASE_URL = "http://www.eventful.com"; | |
| public static final String PATH_JSON = "json"; | |
| public static final String PATH_EVENTS = "events"; | |
| public static final String PATH_SEARCH = "search"; | |
| public static final String URL_EVENTS_SEARCH = "/" + PATH_JSON + "/" + PATH_EVENTS + "/" + PATH_SEARCH; | |
| public static final String PARAM_LOCATION = "location"; | |
| public static final String PARAM_APP_KEY = "app_key"; | |
| public static final String PARAM_DATE = "date"; | |
| public static final String APP_KEY = "4Q7hC5bJXwHMZ99t"; | |
| public static final String VALUE_THIS_WEEK = "This Week"; | |
| public static final String JSON_KEY_EVENTS = "events"; | |
| public static final String JSON_KEY_PACKAGE_EVENTS = "tabular"; | |
| public static final String JSON_KEY_DATE_EVENT = "rf_start_time"; | |
| public static final String JSON_KEY_DESCRIPTION_EVENT = "description"; | |
| public static final String JSON_KEY_TITLE_EVENT = "title"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String getSearchEventsUrl (String location){ | |
| Uri eventUrl = Uri.parse(EventfulApiKeys.BASE_URL).buildUpon() | |
| .appendPath(EventfulApiKeys.PATH_JSON) | |
| .appendPath(EventfulApiKeys.PATH_EVENTS) | |
| .appendPath(EventfulApiKeys.PATH_SEARCH) | |
| .appendQueryParameter(EventfulApiKeys.PARAM_APP_KEY, EventfulApiKeys.APP_KEY) | |
| .appendQueryParameter(EventfulApiKeys.PARAM_LOCATION, location) | |
| .appendQueryParameter(EventfulApiKeys.PARAM_DATE, VALUE_THIS_WEEK) | |
| .build(); | |
| return eventUrl.toString(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment