FAQ  •  Register  •  Login

serviidb.com

<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sun Mar 18, 2012 4:43 am

Re: serviidb.com

Are you guys wanting the restful server return an actual file of the data or the data in the json or xml format?
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Mar 18, 2012 8:29 am

Re: serviidb.com

The plugin content should be in its orginial form as a .groovy and not wrapped in json.

As for your other problem i'm not sure, sorry. Your current query is the content, which then needs to be added as the data in the form of a list to the field plugins, there must be something in the library to do that.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

mpemberton5

DLNA master

Posts: 120

Joined: Sun Aug 28, 2011 9:01 pm

Location: North Carolina, USA

Post Fri Mar 23, 2012 4:17 am

Re: serviidb.com

moltra wrote:Are you guys wanting the restful server return an actual file of the data or the data in the json or xml format?


If you are talking about the actual plugin, then yes, I agree with Will that it should be the actual groovy file.
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Fri Mar 23, 2012 4:27 pm

Re: serviidb.com

mpemberton5 wrote:
moltra wrote:Are you guys wanting the restful server return an actual file of the data or the data in the json or xml format?


If you are talking about the actual plugin, then yes, I agree with Will that it should be the actual groovy file.


I was talking about the information like plugin name, version and download URL, Or the information like Feed name, Feed URL, required plugin.

Yes the groovy file will be the actual groovy file not changed at all.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Fri Mar 23, 2012 5:51 pm

Re: serviidb.com

moltra wrote:I was talking about the information like plugin name, version and download URL, Or the information like Feed name, Feed URL, required plugin.

Yes the groovy file will be the actual groovy file not changed at all.


Everything else other than the groovy file (that I can think of) that is stored on the site that you want to be accessiable should be accessiable via the API in json, xml etc. The whole point is that it is a structured form that is much easier to parse at the other end as libraries are already writen for it. No point re-inventing it by transfering the data in a different format.

One comment about the plugin table, content should not be split across pages unless it is at the bottom of the page. E.g. there is 4oD content on page 1 and on page 2.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Fri Mar 23, 2012 10:56 pm

Re: serviidb.com

will wrote:
moltra wrote:I was talking about the information like plugin name, version and download URL, Or the information like Feed name, Feed URL, required plugin.

Yes the groovy file will be the actual groovy file not changed at all.


Everything else other than the groovy file (that I can think of) that is stored on the site that you want to be accessiable should be accessiable via the API in json, xml etc. The whole point is that it is a structured form that is much easier to parse at the other end as libraries are already writen for it. No point re-inventing it by transfering the data in a different format.

One comment about the plugin table, content should not be split across pages unless it is at the bottom of the page. E.g. there is 4oD content on page 1 and on page 2.


Did not notice that will try to fix it.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sat Apr 07, 2012 8:38 pm

ServiiDB Restful Service beta 0.1

I have the 1st beta of the serviidb restful service ready for testing. I am working on more detailed API documentation, but here is the basics.

  Code:
http://serviidb.com/api

is the restful service URL. Right now it will return plugins and video feeds (currently image and audio resources are also returned with video feeds) That will be changed in the next beta.

Here are the parameters that can be used with the restful service. Only start and num affect the plugins returned.

  Code:
region - Region that you want to search (worldwide is included in all searchs so it is a "or" search).

title - this is a wildcard search so if you search title=the anything with "the" in the title will be returned.

num - this parameter limits the amount of resources returned.  default = 10.

start - this parameter is to allow the clients to start anywhere in the results.  ie get the 1st 10 results and then request the next 10 results.  The database starts with the number 0 so 0-9 would be the 1st 10 results.

format - the type of output from the API.  defaults to json.  Currently only json and html is working.  I am still tweaking html and Working on xml and string formats.

  Code:
http://serviidb.com/api/plugin

will return the 1st 10 plugins in the database.

Output:
  Code:
[{"name":"Trailer Addict","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/traileraddictrss.groovy"},{"name":"SHOUTcast","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createpluginn\/shoutcast.groovy"},{"name":"None","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/"},{"name":"Blip TV","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/BlipTVUrlExtractor.groovy"},{"name":"CBS","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/CBS.groovy"},{"name":"iPlayer (UK)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/IPlayer.groovy"},{"name":"4oD (UK)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/Channel4od.groovy"},{"name":"YouTube","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/youtube.groovy"},{"name":"LiveFeeds","revision":"3","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/livefeeds.groovy"},{"name":"GameSpot","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/gamespot.groovy"}]


  Code:
http://serviidb.com/api/plugin?start=10

would return the 2nd 10 plugins in the database, but there is less than 20 plugins in the database currently so it returns only what is left.

Output:
  Code:
[{"name":"GameTrailers","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/gametrailers.groovy"},{"name":"CNN","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/cnn.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/hulu.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/Hulu.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/Hulu_0.groovy"}]


  Code:
http://serviidb.com/api/plugin?num=50


output:
  Code:
[{"name":"Trailer Addict","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/traileraddictrss.groovy"},{"name":"SHOUTcast","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createpluginn\/shoutcast.groovy"},{"name":"None","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/"},{"name":"Blip TV","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/BlipTVUrlExtractor.groovy"},{"name":"CBS","revision":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/CBS.groovy"},{"name":"iPlayer (UK)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/IPlayer.groovy"},{"name":"4oD (UK)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/Channel4od.groovy"},{"name":"YouTube","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/youtube.groovy"},{"name":"LiveFeeds","revision":"3","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/livefeeds.groovy"},{"name":"GameSpot","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/gamespot.groovy"},{"name":"GameTrailers","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/gametrailers.groovy"},{"name":"CNN","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/cnn.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/hulu.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/Hulu.groovy"},{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/Hulu_0.groovy"}]

You will notice that it shows both versions of the hulu plugin. That is something we need to decide how we are going to handle.

Now for video start and num parameters work the same.

  Code:
http://serviidb.com/api/video

only returns the 1st 10 results since num defautls to 10.
  Code:
[{"Show":"Blip TV Photoshop Users TV","region":"UK","URL":"http:\/\/blip.tv\/photoshop-user-tv\/rss"},{"Show":"TV Highlights","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv"},{"Show":"Popular TV","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/popular\/tv"},{"Show":"CBeebies","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/cbeebies\/list"},{"Show":"Coppers","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/coppers\/4od"},{"Show":"Big Fat Gypsy Weddings","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/big-fat-gypsy-weddings\/4od"},{"Show":"90210","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/90210\/4od"},{"Show":"Skins","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/skins\/4od"},{"Show":"Shameless","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/shameless\/4od"},{"Show":"New Girl","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/new-girl\/4od"}]


  Code:
http://serviidb.com/api/video?region=us


output (included audio and image resources, will be changed in next beta).

  Code:
[{"Show":"CSI","region":"US","URL":"http:\/\/www.cbs.com\/shows\/csi\/video\/"},{"Show":"NCIS","region":"US","URL":"http:\/\/www.cbs.com\/shows\/ncis\/video\/"},{"Show":"Ray William Johnson","region":"Worldwide","URL":"http:\/\/gdata.youtube.com\/feeds\/users\/raywilliamjohnson\/uploads"},{"Show":"VISO Trailers","region":"Worldwide","URL":"http:\/\/gdata.youtube.com\/feeds\/users\/trailers\/uploads"},{"Show":"HD Channels","region":"Worldwide","URL":"https:\/\/sites.google.com\/site\/serviiorss\/LiveFeeds_HD_Channels.rss"},{"Show":"HD Networks","region":"Worldwide","URL":"https:\/\/sites.google.com\/site\/serviiorss\/LiveFeeds_HD_Networks.rss"},{"Show":"HD Sports","region":"Worldwide","URL":"https:\/\/sites.google.com\/site\/serviiorss\/LiveFeeds_HD_Sports.rss"},{"Show":"One HD","region":"Worldwide","URL":"https:\/\/sites.google.com\/site\/serviiorss\/LiveFeeds_One_HD.rss "},{"Show":"Picasa","region":"Worldwide","URL":"https:\/\/picasaweb.google.com\/data\/feed\/base\/user\/user_ID?alt=rss"},{"Show":"Picasa","region":"Worldwide","URL":"https:\/\/picasaweb.google.com\/data\/feed\/base\/user\/user_ID\/albumid\/album_name?alt=rss"}]


  Code:
http://serviidb.com/api/video?title=the


output for any titles with the word "THE" in the title.

  Code:
[{"Show":"The Cleveland Show","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-cleveland-show\/4od"},{"Show":"The Good Wife","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-good-wife\/4od"},{"Show":"The Hotel","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-hotel\/4od"},{"Show":"The Inbetweeners","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-inbetweeners\/4od"},{"Show":"The Big C","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-big-c\/4od"},{"Show":"The IT Crowd","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-it-crowd\/4od"},{"Show":"The Joy of Teen Sex","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-joy-of-teen-sex\/4od"}]


  Code:
http://serviidb.com/api/video?start=10num=10&region=uk&title=the


output: starting at result 10 getting the next 10 results if they exits, in UK or worldwide with the word "the" in the title.

  Code:
[{"Show":"The Cleveland Show","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-cleveland-show\/4od"},{"Show":"The Good Wife","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-good-wife\/4od"},{"Show":"The Hotel","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-hotel\/4od"},{"Show":"The Inbetweeners","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-inbetweeners\/4od"},{"Show":"The Big C","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-big-c\/4od"},{"Show":"The IT Crowd","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-it-crowd\/4od"},{"Show":"The Joy of Teen Sex","region":"UK","URL":"http:\/\/www.channel4.com\/programmes\/the-joy-of-teen-sex\/4od"}]


I am going to be adding a client parameter, and an installed parameter, so that I can keep track in the database what clients are connecting and what they are installing into serviio.

Please let me know if you see any problems or want the data back in a different format.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Apr 08, 2012 7:50 am

Re: serviidb.com

It is looking good, although I have few comments to make it more general and easier to use.

1) Change "Show" to name so that it fits with audio, images and streams
2) Add "repositoryType" which follows the Serviio docs, so FEED, LIVE_STREAM, WEB_RESOURCE
3) You didn't expclitly say it, but passing 'num=0' should return all items
4) Using num and start would be much easier if you say how many items are present. On every response make it return something like this:
  Code:
{"returnedSize":10,"totalSize":15,"items":[..........]}

5) Plugin versions - i've made some comments already
6) Add /api/regions that returns a list of regions that are currently in the database.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sun Apr 08, 2012 11:19 am

Re: serviidb.com

will wrote:1) Change "Show" to name so that it fits with audio, images and streams

I am going to be splitting out the Audio and images, hopefully today.

will wrote:2) Add "repositoryType" which follows the Serviio docs, so FEED, LIVE_STREAM, WEB_RESOURCE

already in issues on bitbucket.

will wrote:3) You didn't expclitly say it, but passing 'num=0' should return all items

Did not think of that will make the changes.

will wrote:4) Using num and start would be much easier if you say how many items are present. On every response make it return something like this:
  Code:
{"returnedSize":10,"totalSize":15,"items":[..........]}

good Idea

will wrote:5) Plugin versions - i've made some comments already

I need to go back through all the posts on this and sort them all out and get with Zip and some of the main plugin creators and figure out which way we want to do it.

will wrote:6) Add /api/regions that returns a list of regions that are currently in the database.

added to issues to work on.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sun Apr 08, 2012 12:57 pm

Re: serviidb.com

Setup code repository, wiki and issues at.

https://bitbucket.org/moltra/serviidb-api

I have opened the code to anyone who wants to look at it and give suggestions.

I have setup a read only mysql database if anyone wants to test or help tweak the code. Please send me a PM to get the information.

I have also setup a developmental copy of the API at serviidb.com/apidev . If anyone wants to see what I have added or changed. This Developmental API will be up and down.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sun Apr 08, 2012 4:14 pm

Re: serviidb.com

I have made some changes in the /apidev restful service. I have split out audio, image, and video. I have also added some new fields in the responses. I will be changing /api over to the new code this evening, If I cannot find any bugs.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Apr 08, 2012 5:00 pm

Re: serviidb.com

Looking at a new example
  Code:
{"Resource":"plugin","returnedSize":10,"totalSize":15,"0":{"name":"Hulu (US)","revision":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/Hulu.groovy"},"1":{"name":.....}}

Would be a real pain to write a parser for because the variables are not fixed due to the returned items all being on the top level with indivial variable names. Rather than seperate items numbered 0, 1, 2... they should be in a list.
  Code:
{"resource":"plugin","returnedSize":10,"totalSize":15,"items":[{"name":"Hulu (US)","revision":"1","url":"http:\/\/serviidb.com\/sites\/default\/files\/Hulu.groovy"},{"name":....}]}


Being picky, it would be nice if variable names were consistent e.g. all java style, you have a mix of styles.

In general, you don't seem to have a concept of API naming vs user facing naming with spaces/no cepcept of keys/ids e.g. in the video section, resourceType (I realise you have only just added this today) is 'Web resource' / 'RSS / Atom' this could be a problem when requesting info from the API in a different language in future. You refrence plugins by their name, rather than a unique key, or do you have protection in the db against duplicate plugin names?

Don't take these complaints as a bad thing though :)
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Sun Apr 08, 2012 6:39 pm

Re: serviidb.com

Current json response:
  Code:
{
    "Resource": "video",
    "returnedSize": 2,
    "totalSize": 60,
    "0": {
        "Show": "Blip TV Photoshop Users TV",
        "region": "UK",
        "URL": "http://blip.tv/photoshop-user-tv/rss",
        "resourceType": "RSS / Atom feed",
        "plugin": "Blip TV"
    },
    "1": {
        "Show": "TV Highlights",
        "region": "UK",
        "URL": "http://feeds.bbc.co.uk/iplayer/highlights/tv",
        "resourceType": "RSS / Atom feed",
        "plugin": "iPlayer (UK)"
    }
}


Requested json response:
  Code:
{
    "resource": "plugin",
    "returnedSize": 10,
    "totalSize": 15,
    "items": [
        {
            "name": "Hulu (US)",
            "revision": "1",
            "url": "http://serviidb.com/sites/default/files/Hulu.groovy"
        }
    ]
}


How is this json response?

  Code:
[
    {
        "Resource": "video",
        "returnedSize": 2,
        "totalSize": 60
    },
    [
        {
            "Show": "Blip TV Photoshop Users TV",
            "region": "UK",
            "URL": "http://blip.tv/photoshop-user-tv/rss",
            "resourceType": "RSS / Atom feed",
            "plugin": "Blip TV"
        },
        {
            "Show": "TV Highlights",
            "region": "UK",
            "URL": "http://feeds.bbc.co.uk/iplayer/highlights/tv",
            "resourceType": "RSS / Atom feed",
            "plugin": "iPlayer (UK)"
        }
    ]
]


  Code:
[{"Resource":"video","returnedSize":2,"totalSize":60},[{"Show":"Blip TV Photoshop Users TV","region":"UK","URL":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"Show":"TV Highlights","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]]


To tell you the truth, I had not even thought about the variable names. I changed them to what I think is "java style".

  Code:
[{"resource":"video","returnedSize":2,"totalSize":60},[{"show":"Blip TV Photoshop Users TV","region":"UK","url":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"show":"TV Highlights","region":"UK","url":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]]


will wrote:In general, you don't seem to have a concept of API naming vs user facing naming with spaces/no cepcept of keys/ids e.g. in the video section, resourceType (I realise you have only just added this today) is 'Web resource' / 'RSS / Atom' this could be a problem when requesting info from the API in a different language in future. You refrence plugins by their name, rather than a unique key, or do you have protection in the db against duplicate plugin names?


I do not have a concept of API naming vs user facing naming with spaces... I can understand how it would be hard requesting information on the resourceType field, but I am looking at how to make it human readable to people who visit the website and look at the feeds there and what a program needs. Not having spaces makes it harder for a human to read, but having them makes it harder for a program to read the feed. Right now I have not thought about using resourceType as a parameter, but I should try and keep that option open. All of the parameters that return a text input, should actually be setup to be a wildcard search. I am not sure if they all are currently, but I will be verifing that they are.

Right now I do not have it setup to allow the taxonomy terms, ie plugin names, resourceType, region setup to be translated to another language. This can be changed, but I am not sure if it would be better or not.

Actually in the database query they are being referenced by a unique ID, but I am displaying the plugin name that is associated with that unique ID. If I referenced plugin "40" you would not know that is was the 4oD (UK) plugin. I am setting up to minimize duplications in the database of the taxonomy terms.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Sun Apr 08, 2012 7:26 pm

Re: serviidb.com

That new response would still require editing before it could be parsed as it is not correct json. (I'm not sure if you ment to, but you enclosed the entire response in array brackets [ and ], rather than {}).
I guess the problem is that this is coming from a DB without the concept of a model, which is expected. One way to evaluate a particular response, is to think how it would be parsed. Because you are not adding variables to parts of the response, I would need to add them first before they could be parsed.

To help explain it, here is a class representing the response I would like:
  Code:
public class PluginResponse{
   String resource;
   int returnedSize;
   int totalSize;
   List<Plugin> items;
   
   public static class Plugin{
      String name;
      int revision;
      String url;
   }
}

It is very clear how to map between the two. For the response that you gave, I would not be able to use gson straight away because it is not correctly structured json, I would need to parse the response manaually, add in the missing variable names to make it correct json, and then parse it to a class.

General comments, they were things to keep in mind, and not that important.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Tue Apr 10, 2012 7:14 am

Re: serviidb.com

I have check the json formatting at http://jsonlint.com/and it says it is valid json. And the json that is being returned is what is created by the php command http://php.net/manual/en/function.json-encode.php. I am not changing anything about the json. I an not sure if there is a format differnce between java json and php json, but I would think that there is not.

  Code:
{
"show":"Blip TV Photoshop Users TV",
"region":"UK",
"url":"http://blip.tv/photoshop-user-tv/rss",
"resourceType":"RSS / Atom feed",
"plugin":"Blip TV"
},


In this example take from the devapi the variables are
show=Blip TV Photoshop Users TV
region=UK
url=http://blip.tv/photoshop-user-tv/rss
plugin=Blip TV.

What variables are you expecting?

If I get a chance today when I get home, I will download a gson parser and see what happens when I try and parse the output I am getting now. The more I read about java and json it seems that they is alot of problems getting gson and json to work together. Here is a page I found that has alot of discussions and answers.

http://stackoverflow.com/questions/4266544/json-deserialization-using-gson
Last edited by moltra on Tue Apr 10, 2012 7:33 am, edited 1 time in total.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Apr 10, 2012 7:31 am

Re: serviidb.com

That block (bar the stray , at the end) is valid.

What I think is not valid is when you combine valid blocks together without naming them. Items in red is where I think something should be. It is the equivilant of having a blank xml tag (<>)

{"details":{"Resource":"video","returnedSize":2,"totalSize":60},"items":[{"Show":"Blip TV Photoshop Users TV","region":"UK","URL":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"Show":"TV Highlights","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]}

Which is why I equested
  Code:
Code:
    {
        "resource": "plugin",
        "returnedSize": 10,
        "totalSize": 15,
        "items": [
            {
                "name": "Hulu (US)",
                "revision": "1",
                "url": "http://serviidb.com/sites/default/files/Hulu.groovy"
            }
        ]
    }


I've just tried an online validator on your full propsed response
  Code:
[{"Resource":"video","returnedSize":2,"totalSize":60},[{"Show":"Blip TV Photoshop Users TV","region":"UK","URL":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"Show":"TV Highlights","region":"UK","URL":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]]

It is 'valid' due to the starting [ and ending ], because that makes it an array so the blocks don't have to be named, however, it shouldn't be reprsented as an array because {resource,returnedSize,totalSize} is not the same type as {show,region,resourceType,url,plugin}.
Changing the end [] to {} makes it invalid, until you change it to match what I had proposed.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Tue Apr 10, 2012 7:45 am

Re: serviidb.com

What I might be able to do is split it into two json responses. The initial information and then the actual data json. Let me change the code real fast and see how it works.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Tue Apr 10, 2012 7:53 am

Re: serviidb.com

I split it into two json groups and here is what I got.

  Code:
{"Resource":"video","returnedSize":2,"totalSize":60}[{"show":"Blip TV Photoshop Users TV","region":"UK","url":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"show":"TV Highlights","region":"UK","url":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]


The 1st json did not have the [] but the array that was json encoded did have the [] even tho the same command was used to encode them both. Must have something to do with the array that is being generated.

Would this work?
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Apr 10, 2012 9:56 am

Re: serviidb.com

It still is not valid if you run it through JSONLint because you cannot add two blocks together like that. To parse that I would have to replace }[ with ,"items":[ and ] with ]} to merge those two blocks together properly.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Tue Apr 10, 2012 10:17 am

Re: serviidb.com

How about this format?

  Code:
[{"resource":"video","returnedSize":2,"totalSize":60},["items",{"show":"Blip TV Photoshop Users TV","region":"UK","url":"http:\/\/blip.tv\/photoshop-user-tv\/rss","resourceType":"RSS \/ Atom feed","plugin":"Blip TV"},{"show":"TV Highlights","region":"UK","url":"http:\/\/feeds.bbc.co.uk\/iplayer\/highlights\/tv","resourceType":"RSS \/ Atom feed","plugin":"iPlayer (UK)"}]]
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
PreviousNext

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 11 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.