Taiwan Plus on KU updated their website. They completely changed how the EPG is fetched. I saw it as a challenge, as it was completely different then anything i ran into before. Before, it was a json result from an http api call, that returned sequential EPG information. I could fetch the data sequentially not having to save away or organize the json.
The new format, they embed the json in the actual html page. So, no longer a separate URL for api, as its embedded. First off, i had to strip out just the embedded json. That part was easy, but then i realized the information was broken into data subsets. Each json field is a index of lists, and then different fields referenced an index # to the lists. Before i could tackle this, i actually had to write a function that decodes the entire json into an indexed array so to speak. That was what was new and i had to program. That took me 4 hours or so. Now i have a fully indexed json in a memory spaced array.
Here is an example (very basic and very show friendly) of how they jumbled the json data.
0 : Taiwan Talks
1: random
2:random
3:Taiwan talks is a bla bla show
4: Episode 78
5:February 26th 3:30pm
6:Schedule,Title:0,Desc:3,AirTime:5,Episode:4
So, i had index it into memory by the index as shown above, 0-6. I then had to search for a schedule entry and then read the airtime value which is a # which told me where the actual airtime is located ie. index 5, and then i would reference index 5 to get the actual date/time and the same held true to fetch the show title, and the show description etc. This json didn't just have 6 index items, it literally had over 7,000 index items that much had nothing to do with anything i cared about. Talk about burying data. Also, the data was jumbled and in nonsensical order.
I had to make sure my code was flawless, as the index #'s are not specified, they are the number of lists, and if i didn't decode it perfectly, my # of lists wouldn't match, which would mean that when i was told where to fetch certain information from, if my index #'s didn't match i would grab the wrong information.
In the end, My KungFu was strong. I have restored my EPG for Tawain Plus.