Skip to content

Instantly share code, notes, and snippets.

@Qasem-h
Created September 16, 2019 15:42
Show Gist options
  • Save Qasem-h/a78acde366a0a71dd74e24df2b1196aa to your computer and use it in GitHub Desktop.
Save Qasem-h/a78acde366a0a71dd74e24df2b1196aa to your computer and use it in GitHub Desktop.
let data = { results: [
{
type: "EVENT",
CT: "Zimbabwe Premier Soccer League",
FI: "82829971",
FULL_TIME: "90",
MO: "0",
MP: "0",
MS: "0",
NAME: "Chicken Inn FC v Manica Diamonds FC"
},
{
type: "TEAM_GROUP",
CT: "Soccer",
ID: "1"
},
{
type: "TEAM",
NA: "Chicken Inn FC"
},
{
type: "TEAM",
NA: "Manica Diamonds FC"
},
{
type: "EXTRA_SCORES",
ID: "82829971",
NA: ""
},
{
type: "SCORES",
ID: "1",
NA: "IGoal",
OR: "1",
SY: "14",
VL: "1"
},
{
type: "SCORES_CELL",
D1: "0",
D2: "",
ID: "0",
OR: "0",
SY: "0"
},
{
type: "SCORES_CELL",
D1: "1",
D2: "",
ID: "1",
OR: "1",
SY: "0"
},
{
type: "MARKET",
COLUMN_NUMBER: "1",
DEFAULT_OPEN: "1",
ID: "1777",
NAME: "Fulltime ReSUCCESSlt",
ORDER: "0"
},
{
type: "COLUMN",
COLUMN_NUMBER: "3",
ID: "1",
NAME: "",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Chicken Inn FC",
OD: "15/2",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Draw",
OD: "10/3",
ORDER: "1"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Manica Diamonds FC",
OD: "1/3",
ORDER: "2"
},
{
type: "MARKET",
COLUMN_NUMBER: "1",
DEFAULT_OPEN: "1",
ID: "10115",
NAME: "Duble Chance",
ORDER: "1"
},
{
type: "COLUMN",
COLUMN_NUMBER: "3",
NAME: "",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Chicken Inn FC ORDER Draw",
OD: "9/4",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Manica Diamonds FC ORDER Draw",
OD: "1/20",
ORDER: "1"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Chicken Inn FC ORDER Manica Diamonds FC",
OD: "1/5",
ORDER: "2"
},
{
type: "MARKET",
COLUMN_NUMBER: "1",
DEFAULT_OPEN: "1",
NAME: "2nd Goal",
ORDER: "2"
},
{
type: "COLUMN",
COLUMN_NUMBER: "3",
NAME: "",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "Chicken Inn FC",
OD: "8/5",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "No 2nd Goal",
OD: "7/4",
ORDER: "1"
},
{
type: "PARTICIPANT",
NAME: "Manica Diamonds FC",
OD: "8/5",
ORDER: "2"
},
{
type: "MARKET",
COLUMN_NUMBER: "3",
DEFAULT_OPEN: "1",
NAME: "Match Goals",
ORDER: "3"
},
{
type: "COLUMN",
COLUMN_NUMBER: "1",
NAME: "Count : 1",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "1.5",
OD: "",
ORDER: "0",
SUCCESS: "1"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "2.5",
OD: "",
ORDER: "1",
SUCCESS: "1"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "3.5",
OD: "",
ORDER: "2",
SUCCESS: "1"
},
{
type: "PARTICIPANT",
HA: "",
HD: "",
NAME: "4.5",
OD: "",
ORDER: "3",
SUCCESS: "1"
},
{
type: "COLUMN",
COLUMN_NUMBER: "1",
NAME: "Over",
ORDER: "1"
},
{
type: "PARTICIPANT",
HA: "1.5",
HD: " 1.5",
NAME: "Over ",
OD: "2/5",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "2.5",
HD: " 2.5",
NAME: "Over ",
OD: "13/8",
ORDER: "1"
},
{
type: "PARTICIPANT",
HA: "3.5",
HD: " 3.5",
NAME: "Over ",
OD: "5/1",
ORDER: "2"
},
{
type: "PARTICIPANT",
HA: "4.5",
HD: " 4.5",
NAME: "Over ",
OD: "10/1",
ORDER: "3"
},
{
type: "COLUMN",
COLUMN_NUMBER: "1",
NAME: "Under",
ORDER: "2",
SY: "10"
},
{
type: "PARTICIPANT",
HA: "1.5",
HD: " 1.5",
NAME: "Under ",
OD: "7/4",
ORDER: "0"
},
{
type: "PARTICIPANT",
HA: "2.5",
HD: " 2.5",
NAME: "Under ",
OD: "4/9",
ORDER: "1"
},
{
type: "PARTICIPANT",
HA: "3.5",
HD: " 3.5",
NAME: "Under ",
OD: "1/9",
ORDER: "2"
},
{
type: "PARTICIPANT",
HA: "4.5",
HD: " 4.5",
NAME: "Under ",
OD: "1/50",
ORDER: "3"
},
]
}
let chars = data["results"];
for (let i = 0, len = chars.length; i < len; i++) {
if (chars[i].type == "MARKET") {
var market_name = chars[i].NAME;
console.log(market_name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment