~josephjamesmills/+junk/americanFootball_api_stuff

« back to all changes in this revision

Viewing changes to Api/espn/GetAllAthletes.qml

  • Committer: Joseph Mills
  • Date: 2013-12-15 15:25:28 UTC
  • Revision ID: josephjamesmills@gmail.com-20131215152528-vke40bcaabivhpm9
for dude to pull stuff out

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
import QtQuick.XmlListModel 2.0
 
3
 
 
4
/*
 
5
****************************
 
6
**     ESPN
 
7
****************************
 
8
This is for Player IUnfo and stats along with Images and what not.
 
9
*/
 
10
 
 
11
XmlListModel{
 
12
    id:nfo
 
13
    source: "http://api.espn.com/v1/sports/football/nfl/athletes/?_accept=text%2Fxml&apikey=2h5sytpesd97v5fxmrfrkm7x"
 
14
    query: "/response/sports/sportsItem/leagues/leaguesItem/athletes/athletesItem"
 
15
 
 
16
    XmlRole{name:"id"; query: "id/string()"}
 
17
    XmlRole{name:"firstName"; query: "firstName/name/string()"}
 
18
    XmlRole{name:"lastName"; query: "lastName/string()"}
 
19
    XmlRole{name:"fullName"; query: "fullName/string()"}
 
20
    XmlRole{name:"displayName"; query: "displayName/string()"}
 
21
    XmlRole{name:"shortName"; query: "shortName/string()"}
 
22
 
 
23
    XmlRole{name:"playersUrl"; query: "links/api/athletes/string()"}
 
24
    XmlRole{name:"playersNews"; query: "links/api/athletes/news/string()"}
 
25
    XmlRole{name:"playerNotes"; query: "links/api/athletes/notes/string()"}
 
26
 
 
27
    onStatusChanged: {
 
28
        if(status === XmlListModel.Loading){console.log("loading")}
 
29
        if(status === XmlListModel.Error){console.log("Error \t"+ errorString())}
 
30
        if(status === XmlListModel.Ready){
 
31
            if (count > 0)
 
32
                for(var i = 0 ; i < count ; i++){
 
33
                 console.log(nfo.get(i).id)
 
34
                }
 
35
        }
 
36
    }
 
37
}