Read News, Get Information about the Latest Music, Movie, and Book Reviews with the USA Today API Plug-in

Posted: April 24th, 2013 | Author: | Filed under: API, Plugin | Tags: , | Comments Off

usatoday_logo2

Our new USA Today API Plug-in allows you to read news from different categories offered by USA Today and get information about the latest music, movie, and book reviews. Also, you can find top salaries for different sports leagues.

Adding USA Today API Plug-in to Your App

To add this plug-in to an app, you will just need to follow these steps in Appery.io:

  1. From the Appery.io builder, select Create New and then From Plug-in.
  2. Click the check box for USA Today API, and then click the Import selected plugins button.
  3. Select USATODAY_startScreen as the start page and check the box to set your API keys.
    usa057
  4. The Services/USATODAY_ServicesSettings file opens and you can set the API keys.
  5. Open Project/App settings and select there USATODAY_Theme as the project theme.

    usa058Here you can also define the project start page if you have not done it earlier.

How to Get API Keys

To run the app you need to register a new account on http://developer.usatoday.com, then create new Application and get keys.

Go to ServicesUSATODAY_ServicesSettings and enter the keys in appropriate fields.

usa01

The App

To  use the app, follow these steps:

  1. On the start page you will find a list of Top News
    usa002
  2. You can find lists of Top 10 Salaries in Sports Leagues:
    usa003usa004
  3. Find news in different categories, choose those that interest you most:
    usa005
  4. Look through the book, movie and music reviews:
    usa006usa007usa008
  5. Using the app you can also search for articles including the keyword.

Under the Hood

Now that we’ve walked through the app, let’s take a peek under the hood.

Services

Services from the plug-in are linked to UI components as part of the design of the app. The following REST services that are defined in the USA Today API plug-in are used in the app.

USATODAY_TopNews

The USATODAY_TopNews service is used for getting the list of top news offered by USA Today.
REST Service Properties displays the URL, main settings, and whether a proxy is used as shown below:

usa009

Request Parameters tab is shown below:

usa010

{articles_key} parameter value is set in the USATODAY_ServicesSettings.
count parameter is the number of news to get.  

The service can be instantly tested and the response created automatically based on the return response (JSON):

usa011

Response Parameters tab:

usa012

The other services are set in the same way with their own parameters.

USATODAY_LeaguesList

The USATODAY_LeaguesList service is used for getting the list of available sports leagues. Service Properties:

usa013

Request Parameters:

usa014
{sports_salaries_key} parameter value is set in the USATODAY_ServicesSettings.

Response Parameters:

usa015

USATODAY_TopSalaries

The USATODAY_TopSalaries service is used for getting the list of top salaries from specified league. Service Properties:

usa016

Request Parameters:

usa017
{sports_salaries_key} parameter value is set in the USATODAY_ServicesSettings.
top parameter is the number of salaries to get.
league parameter is the specified league. To get leagues list you can use USATODAY_LeaguesList service.

Response Parameters:

usa018

USATODAY_NewsCategorys

The USATODAY_NewsCategorys service is used to get the list of available news categories. This service created from custom response and use Echo mode. The list of available news categories you can get on http://developer.usatoday.com. This service does not have URI and main settings:

usa019

Response Parameters:

usa020

USATODAY_NewsFromCategory

The USATODAY_NewsFromCategory service is used to perform news from specified news category offered by USA Today. Service Properties:

usa021

Request Parameters:

usa022
{articles_key} parameter value is set in the USATODAY_ServicesSettings.
count parameter is a number of news to get.
section parameter is the specified news category.

Response Parameters:

usa023

USATODAY_MovieReviews

The USATODAY_MovieReviews service is used or getting the list of last movie reviews offered by USA Today. Service Properties:

usa024

Request Parameters:

usa025
{movie_reviews_key} parameter value is set in the USATODAY_ServicesSettings.
count parameter is the number of reviews to get.

Response Parameters:

usa026

USATODAY_BooksReviews

The USATODAY_BooksReviews service is used for getting the list of last books reviews offered by USA Today. Service Properties:

usa027

Request Parameters:

usa028

{book_reviews_key} parameter value set in the USATODAY_ServicesSetting.
count parameter is the number of reviews to get.

Response Parameters:

usa029

USATODAY_MusicReviews

The USATODAY_MusicReviews service is used for getting the list of last misic reviews offered by USA Today. Service Properties:

usa030

Request Parameters:

usa031

{music_reviews_key} parameter value set in the USATODAY_ServicesSetting.
count parameter is the number of reviews to get.

Response Parameters:

usa032

USATODAY_Search

The USATODAY_Search service is used to perform search by news offered by USA Today. Service Properties:

usa033

Request Parameters:

usa034

{articles_key} parameter value set in the USATODAY_ServicesSetting.
keyword parameter is a search word or phrase.

Response Parameters:

usa035

Mapping the UI to the Services

One of the most important  part in the app design is mapping service to UI components. Here we will show you some examples of mapping for pages.

USATODAY_startScreen

The USATODAY_TopNews service is added to the USATODAY_startScreen page:

usa036

The service needs the following mapping:

usa037

USATODAY_Leagues_list

The USATODAY_LeaguesList service is added to the USATODAY_Leagues_list page:

usa038

The service needs the following mapping:

usa039

USATODAY_Top_salaries

The USATODAY_TopSalaries service is added to the USATODAY_Top_salaries page:

usa040

The service needs the following mappings:

usa041 usa042

USATODAY_News

The USATODAY_NewsCategorys service is added to the USATODAY_News page:

usa043

The service needs the following mappings:

usa044

USATODAY_News_from_category

The USATODAY_NewsFromCategory service is added to the USATODAY_News_from_category page:

usa045

The service needs the following mappings:

usa046 usa047

USATODAY_Book_reviews

The USATODAY_BooksReviews service is added to the USATODAY_Book_reviews page:

usa048

The service needs the following mappings:

usa049

USATODAY_Movie_reviews

The USATODAY_MovieReviews service is added to the USATODAY_Movie_reviews page:

usa050

The service needs the following mappings:

usa051

USATODAY_Music_reviews

The USATODAY_MusicReviews service is added to the USATODAY_Music_reviews page:

usa052

The service needs the following mappings:

usa053

USATODAY_Search

The USATODAY_Search service is added to the USATODAY_Search page:

usa054

The service needs the following mappings:

usa055usa056