lundi 1 mai 2017

How do i pick Random Value in this JSON structure?

I'm trying to get random Song from JSON which is sorted with Feeling/Genre/Artist/Songs this is my json file

// music_link.json

{
"Calm" : {
  "Jazz" : {
     "Limes" : {
            "Hooplah" : "http://ift.tt/2gor4KQ",
            "Blase" : "http://ift.tt/2oYb9C5",
            "Selfless" : "http://ift.tt/2pADySt"
  },
     "DemiCat" : {
            "Swingin' with a cat" : "http://ift.tt/2oY8LLj"
  },
     "Glen Check" : {
            "I've got this feeling" : "http://ift.tt/2pAnvnO",
            "Me & U (Remix Version)" : "http://ift.tt/2oY7Dr2"
  }
}
},

"Excite" :{
   "EDM" : {
     "MonsterCat" : {
       "Feint" : {
            "Snake Eyes" : "http://ift.tt/2pAzotU",
            "Arrowhead" : "http://ift.tt/2kDuElL"
    },
       "Hyper Potions": {
            "Surf" : "http://ift.tt/2kEIGRa",
            "Checkpoint" : "http://ift.tt/1OSXuIr",
            "Matches" : "http://ift.tt/2fXTr1t"
    }
  }
}
},

"Tired" : {
   "Beat" : {
     "Vibez" : {
            "Another Rainy Day" : "http://ift.tt/2gmld4I"
  },
     "Taiko" : {
            "Reflection" : "http://ift.tt/2pAAupE"
  }
}}}

By using for, I want to get the URL in Each Songs Randomly.

Do i need to make list for each values of Feeling/Genre/Artist/Songs ?

Or should i fix the sorting of the data? (I'm kinda new for JSON..Sorry)




Aucun commentaire:

Enregistrer un commentaire