Apologies if this has been asked before, I tried a search and couldn't find a solution.
I'm using the WebParser to retrieve data from my SickBeard installation, so far it is working well but I have run into a problem with the order in which the data is processed.
The data that is being read in:
Code: Select all
{
"data": {
"missed": [],
"soon": [
{
"airdate": "2012-01-26",
"airs": "Thursday 8:00 PM",
"ep_name": "The Beta Test Initiation",
"ep_plot": "Leonard and Penny deal with the idea of starting a relationship again and Raj finally finds a \"woman\" he can talk to without being drunk, in the form of Siri on his new iPhone. Meanwhile, Sheldon decides to start a YouTube series entitled \"Sheldon Cooper presents Fun with Flags\" with the help of Amy.",
"episode": 14,
"network": "CBS",
"quality": "HD",
"season": 5,
"show_name": "The Big Bang Theory",
"show_status": "Continuing",
"tvdbid": 80379,
"weekday": 4
},
{
"airdate": "2012-01-27",
"airs": "Friday 9:00 PM",
"ep_name": "Forced Perspective",
"ep_plot": "Olivia continues to cope with the ominous warning from the Observers, while Peter and the team track a girl with the mysterious ability to predict death.",
"episode": 10,
"network": "FOX",
"quality": "HD",
"season": 4,
"show_name": "Fringe",
"show_status": "Continuing",
"tvdbid": 82066,
"weekday": 5
},
{
"airdate": "2012-01-29",
"airs": "Sunday 9:30 PM",
"ep_name": "Stanny Tendergrass",
"ep_plot": "When Stan finally has enough money to afford a membership at the golf club he has worked at for the past thirty summers, his hard work and perseverance prove to be futile when the club gives a membership to Steve first. However, things are not all what they seem when Stan realizes who the club owner really is.",
"episode": 9,
"network": "FOX",
"quality": "SD",
"season": 8,
"show_name": "American Dad!",
"show_status": "Continuing",
"tvdbid": 73141,
"weekday": 7
},
{
"airdate": "2012-01-29",
"airs": "Sunday 9:00 PM",
"ep_name": "Livin' on a Prayer",
"ep_plot": "When Stewie's new best friend falls ill, Lois takes him to the hospital where she finds out he has a critical, but treatable, disease. However, the boy's parents refuse treatment due to their religious beliefs, leaving Lois no choice but to take drastic measures to seek treatment for the boy herself. Meanwhile, Peter has a religious experience of his own.",
"episode": 12,
"network": "FOX",
"quality": "Any",
"season": 10,
"show_name": "Family Guy",
"show_status": "Continuing",
"tvdbid": 75978,
"weekday": 7
}
],
"today": [
{
"airdate": "2012-01-23",
"airs": "Monday 9:00 PM",
"ep_name": "Kit Nelson",
"ep_plot": "When child killer Kit Nelson, a terrifying kidnapper who always returns his victims home - after he's killed them - reappears from the past, the team is in a race against time to catch the man before he kills again.",
"episode": 3,
"network": "FOX",
"quality": "HD",
"season": 1,
"show_name": "Alcatraz",
"show_status": "Continuing",
"tvdbid": 248646,
"weekday": 1
}
]
},
"message": "",
"result": "success"
}
Code: Select all
RegExp="(?siU)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)(?(?=.*airdate").*airdate": "(.*)",)(?(?=.*show_name").*show_name": "(.*)",)(?(?=.*tvdbid").*tvdbid": (.*),)"
The issue I have is the source is split into sections, "Missed", "Soon" and "Today". This means that the array is populated in that order "Missed then Soon then Today. I need it in the following order: Missed, Today then Soon.DEBUG: (68:05:48.583) WebParser.dll: Fetching: http://192.168.0.100:8080/api/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/?cmd=future&sort=date&type=today|missed|soon
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 0) {
"data": {
"missed": [],
"soon": [
{
"airdate": "2012-01-26",
"airs": "Thursday 8:00 PM",
"ep_name": "The Beta Test Initiation",
"ep_plot": "Leonard and Pe
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 1) 2012-01-26
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 2) The Big Bang Theory
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 3) 80379
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 4) 2012-01-27
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 5) Fringe
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 6) 82066
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 7) 2012-01-29
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 8) American Dad!
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 9) 73141
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 10) 2012-01-29
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 11) Family Guy
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 12) 75978
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 13) 2012-01-23
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 14) Alcatraz
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 15) 248646
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-6-Date] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-6-Show] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-6-Link] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-7-Date] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-7-Show] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-7-Link] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-8-Date] Not enough substrings!
WARNING: (68:05:48.676) WebParser.dll: [MeasureSB1-8-Show] Not enough substrings!
WARNING: (68:05:48.692) WebParser.dll: [MeasureSB1-8-Link] Not enough substrings!
WARNING: (68:05:48.692) WebParser.dll: [MeasureSB1-9-Date] Not enough substrings!
WARNING: (68:05:48.692) WebParser.dll: [MeasureSB1-9-Show] Not enough substrings!
WARNING: (68:05:48.692) WebParser.dll: [MeasureSB1-9-Link] Not enough substrings!
Code: Select all
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 1) 2012-01-26
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 2) The Big Bang Theory
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 3) 80379
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 4) 2012-01-27
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 5) Fringe
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 6) 82066
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 7) 2012-01-29
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 8) American Dad!
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 9) 73141
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 10) 2012-01-29
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 11) Family Guy
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 12) 75978
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 13) 2012-01-23
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 14) Alcatraz
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 15) 248646
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 14) Alcatraz
DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 15) 248646
Because the above show was listed in the "Today" section it was added at the end of the array and is displayed at the end of the list.
I really can't think of a way to process this data so the array is populated in the correct order.
Thanks in advance and please let me know if you require any further information.
Also, as a side question. Can anyone tell me why I have the following data in Index(0):
Thanks.DEBUG: (68:05:48.676) WebParser.dll: [SBQuery1] (Index 0) {
"data": {
"missed": [],
"soon": [
{
"airdate": "2012-01-26",
"airs": "Thursday 8:00 PM",
"ep_name": "The Beta Test Initiation",
"ep_plot": "Leonard and Pe