I am trying to create a generic site for OnlineVideos. The site returns JSON for categories, subcategories and videos. I have the categories working and subcategories partially. The problem I am having is how to ignore the first description and only process the subcategories array. Here is my regex, and the JSON
The video list is formated very similar, but I think once I get the sub categories I can get the video list.
Also if there is subcategories of sub categories, is that possible?
ie;
Code:
{"description":"(?<description>[^"]*)","key":"(?<url>[^"]*)","name":"(?<title>[^"]*)","type(?:(?!vert).)*"vert(?:(?!sm").)*sm":"(?<thumb>[^"]*)",(?:(?!}},).)*}},
Code:
{
"category": {
"description": "useless category description",
"key": "useless category key",
"name": "Useless Category Name",
"type": "container",
"tags": ["cat tag"],
"images": {
},
"subcategories": [{
"description": "Description1",
"key": "subcat1",
"name": "SubCat 1",
"type": "container",
"tags": ["blahtag"],
"images": {
"horizontal": {
"md": "http://foo.bar/hm.png",
"sm": "http://foo.bar/hs/png"
},
"vert": {
"md": "http://foo.bar/vm.png",
"sm": "http://foo.bar/vs/png"
}
}
},
{
"description": "Description2",
"key": "subcat2",
"name": "SubCat 2",
"type": "container",
"tags": ["blahtag"],
"images": {
"horizontal": {
"md": "http://foo.bar/hm.png",
"sm": "http://foo.bar/hs/png"
},
"vert": {
"md": "http://foo.bar/vm.png",
"sm": "http://foo.bar/vs/png"
}
}
}]
}
}
The video list is formated very similar, but I think once I get the sub categories I can get the video list.
Also if there is subcategories of sub categories, is that possible?
ie;
Code:
Audio
80s
<song list>
70s
<songlist>
Video
Action
<movie list>
Comedy
<movie list>
...