logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
burie  
#1 Posted : Tuesday, April 23, 2019 1:43:16 AM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
I tried to config a JSON dataSurce, but the message is unexpected character "<"
The JSON comes out of a PHP Script.
When I let the script write the JSON in a File and open that in a editor, there is no such char.
I have a screenshot available...

Where is the solution?


ScreenJSON.jpg (214kb) downloaded 4 time(s).
stigaard  
#2 Posted : Tuesday, April 23, 2019 2:34:44 AM(UTC)
stigaard

Rank: Advanced Member

Groups: Registered
Joined: 5/20/2015(UTC)
Posts: 493
Man
Denmark
Location: Copenhagen, Denmark

Thanks: 383 times
Was thanked: 100 time(s) in 79 post(s)
Wrap your output into an array. E.g. [...]
burie  
#3 Posted : Tuesday, April 23, 2019 2:57:14 AM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: stigaard Go to Quoted Post
Wrap your output into an array. E.g. [...]
I do not quite understand what that helps me.

EDIT...
For understanding... what you see in the screenshot is not the source, it is the result. It is the result of result of a website parsing.
calamityjane  
#4 Posted : Friday, April 26, 2019 12:26:32 PM(UTC)
calamityjane

Rank: Advanced Member

Groups: Registered
Joined: 9/26/2014(UTC)
Posts: 104
Man
Location: Canada

Thanks: 39 times
Was thanked: 5 time(s) in 5 post(s)
I am also looking for help with JSON as a datasource.

A web query of the JSON source looks like this ( well a lot more data but in this format):

{"SiteKit":{"Parameters":{"feed":"modulekit","view":"roster","key":"xxxxxxxxxxxx","fmt":"json","client_code":"cchl","lang":"en","season_id":0,"team_id":"7","lang_id":1,"league_id":"1"},"Roster":[{"id":"5902","person_id":"6732","active":"1","first_name":"Antoine","last_name":"Bourdeau","phonetic_name":"","display_name":"","shoots":"L","catches":"L","hometown":"Montreal, QC","homeprov":"","homecntry":"Canada","homeplace":"Montreal, QC, Canada","birthtown":"Montreal, QC","birthprov":"","birthcntry":"Canada","birthplace":"Montreal, QC, ","height":"6-0","weight":"193","height_hyphenated":"6-0","hidden":"0","current_team":"","player_id":"5902","status":"","birthdate":"2000-02-14","birthdate_year":"'00","rawbirthdate":"2000-02-14","latest_team_id":"7","tp_jersey_number":"1","rookie":"0","position_id":"7","position":"G","nhlteam":"","playerId":"5902","isRookie":"&nbsp;","h":"6-0","w":"193","draftinfo":[],"name":"Antoine Bourdeau","flags":[],"player_image":"https:\/\/assets.leaguestat.com\/cchl\/240x240\/5902.jpg"},{"id":"5899","person_id":"6729","active":"1","first_name":"Mathieu","last_name":"Wuth","phonetic_name":"","display_name":"","shoots":"R","hometown":"Broomfield, CO","homeprov":"","homecntry":"USA","homeplace":"Broomfield, CO, USA","birthtown":"Broomfield, CO","birthprov":"","birthcntry":"USA","birthplace":"Broomfield, CO, ","height":"6-2","weight":"174","height_hyphenated":"6-2","hidden":"0","current_team":"","player_id":"5899","status":"","birthdate":"2000-06-01","birthdate_year":"'00","rawbirthdate":"2000-06-01","latest_team_id":"7","tp_jersey_number":"5","rookie":"0","position_id":"1","position":"D","nhlteam":"","playerId":"5899","isRookie":"&nbsp;","h":"6-2","w":"174","draftinfo":[],"name":"Mathieu Wuth","flags":[],"player_image":false},

29 more player sets of data then finishes

{"id":"18206","first_name":"Brooks","last_name":"Taylor","name":"Brooks Taylor","coach_id":"490","role_id":"16","role":"Equipment Manager","person_id":"6069","hometown":"","homeprov":"","jersey_number":"0","start_date":"2019-03-16","end_date":"","is_admin":"0"}]],"Copyright":{"required_copyright":"Official statistics provided by Leaguestat","required_link":"http:\/\/leaguestat.com","powered_by":"Powered by HockeyTech.com","powered_by_url":"http:\/\/hockeytech.com"}}}

When vMIX tries to read this data source it generates the message:

ERROR: A column named "id" already belongs to this Data Table

Is my data source corrupted ? or .......

Thanks

Whit
burie  
#5 Posted : Friday, April 26, 2019 2:32:40 PM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
i could imagine that vmix has a problem with chars like "[" on the wrong or unlucky position :-)
BUT why didn't You create your own topic?
chrisg101  
#6 Posted : Wednesday, June 26, 2019 10:39:14 PM(UTC)
chrisg101

Rank: Newbie

Groups: Registered
Joined: 8/21/2018(UTC)
Posts: 3
Location: Melbourne

Hi Burie - I was having a similar issue "Encountered unexpected character '<'" - when adding a JSON source.

Did the suggestion fix your issue?
admin  
#7 Posted : Thursday, June 27, 2019 2:18:24 AM(UTC)
admin

Rank: Administration

Groups: Administrators
Joined: 1/13/2010(UTC)
Posts: 5,162
Man
Location: Gold Coast, Australia

Was thanked: 4174 time(s) in 1498 post(s)
In the original case posted in this thread, the php file was being loaded directly from disk, so it didn't have any JSON inside it, only code.
If they loaded it from a web site setup to server PHP correctly, it would have worked correctly.
burie  
#8 Posted : Thursday, June 27, 2019 4:28:47 AM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: admin Go to Quoted Post
In the original case posted in this thread, the php file was being loaded directly from disk, so it didn't have any JSON inside it, only code.
If they loaded it from a web site setup to server PHP correctly, it would have worked correctly.

DAMN you're right. My fault. I have a apache running behind, but called the PHP File the wrong way. E:\_Data is the localhost folder.
I will try it ASAP, I'm not near this PC.
Quote:
Hi Burie - I was having a similar issue "Encountered unexpected character '<'" - when adding a JSON source.
Did the suggestion fix your issue?

On another thread I got a good hint for a solution with PHP and XML. Until the end I had used to the output return (), how to do that with PHP functions. But since I use echo for the output instead, this works. Maybe that's an approach as well.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.