You are here

Grab JSON correctly

4 posts / 0 new
Last post
msallal
Offline
Donator
Joined: 2 years
Last seen: 6 months
Grab JSON correctly

I have this JSON

{
"schedule": [
{
"day": "الأربعاء",
"date": "2022-03-30",
"programs": [
{
"time": "07:30 PM",
"nowShowing": false,
"live": true,
"program_id": 67,
"name": "نشرة الأخبار",
"schedule_image": "https://backend.roya.tv/imagechanger/Size03Q40R169/images/programs/67/Be...",
"schedule_image_Mob": "https://backend.roya.tv/imagechanger/Size03Q40R9134/images/programs/67/k...",
"program_type": 1,
"description": "تبث يومياً على الهواء مباشرة الساعة 07:30 مساءً بتوقيت العاصمة الأردنية عمان، تتألف من أخبار سياسية، اجتماعية، اقتصادية، رياضية محلية وفلسطينية وعربية ودولية بالإضافة استعراض لحالة الطقس المتوقعة .",
"reachable": false
},
{
"time": "08:30 PM",
"nowShowing": true,
"live": true,
"program_id": 59,
"name": "نبض البلد",
"schedule_image": "https://backend.roya.tv/imagechanger/Size03Q40R169/images/programs/59/ZU...",
"schedule_image_Mob": "https://backend.roya.tv/imagechanger/Size03Q40R9134/images/programs/59/3...",
"program_type": 1,
"description": "برنامج سياسي يتناول العديد من القضايا المحلية، العربية والعالمية باستضافة أشخاص متخصصين ويعرض البرنامج تقارير ميدانية ويتواصل مع الجمهور من خلال التعليقات عبر مواقع التواصل الاجتماعي ويطرحها على الضيوف خلال الحلقة.",
"reachable": true
},

it started by date and then followed by a list of schedules, the show has time only, there is no date, I have to grab it based on parent date, how can I grab this day by day

appreciate your help
Thanks

Attachments: 
Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 8 years
Last seen: 7 hours

webgrab will keep track of the date for you.
unless you tell it otherwise it assumes the first day is today.
i had a look at the site.

if you read section 4.3 site dependent data maxdays setting.

maxdays, specifies the number of days n for which TV guide data is provided by the site, followed by how many index pages p is used for it. If n and p are equal, e.g. 7 days on 7 pages, you can either specify 7.7 or just 7. However, if the site has a multiday e.g. a weekly index_page 7.1 must be specified.

so this site is 7 days epg on 1 page so maxdays=7.1

so as i said just scrub you shows with the start time/title,ect(dont worry about the date).
when webgrab reaches midnight it automatically changes the date for each show to tomorrow,the next day,ect.

mat8861
Offline
WG++ Team memberDonator
Joined: 8 years
Last seen: 2 hours
msallal
Offline
Donator
Joined: 2 years
Last seen: 6 months

this seems work well, Thanks Mat
much appreciated

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl