FAQ  •  Register  •  Login

serviidb.com

<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Wed Feb 29, 2012 5:55 am

Re: serviidb.com

Ignore all of this. I have left if here just as historical record of my cluelessness.

I have the beginning of the Restful server setup. Right now it is returning way to many fields and I am trying to cut them down. I am posting this to give other developers a peak on how it is setup right now. I hope to get rid of some steps in the future, but I cannot figure out how to include a search for the <tid> field. tid stands for taxonomy term, which is what durpal uses to link content. You have to watch out cause a resouces will have a <tid> field for each taxonomy term used in the content.

As you will see at the bottom of this post, I cannot figure out how to just get the media_resources for an individual plugin, right now each media_resource needs to be downloaded and checked to see if it requires the plugin. This is one thing I am working on figuring out. To be able to get just the media_resources for the selected plugin.

This one should give you a list of all the plugins.
  Code:
http://www.serviidb.com/rest/node?fields=title&parameters[type]=plugin

which gives the information in this format.
  Code:
<?xml version="1.0" encoding="UTF-8"?>
-<result is_array="true">-<item><title>SHOUTcast</title><uri>http://www.serviidb.com/rest/node/</uri></item>-<item><title>Trailer Addict</title><uri>http://www.serviidb.com/rest/node/</uri></item>-<item><title>Hulu (US)</title><uri>http://www.serviidb.com/rest/node/</uri></item>


You can see the different plugin titles between the <title> </title> field.

If you use that title in the following to get the information about the plugin.
  Code:
http://www.serviidb.com/rest/node?parameters[title]=shoutcast


Which gives you the following.
  Code:
<?xml version="1.0" encoding="utf-8"?>
<result is_array="true"><item><nid>106</nid><vid>123</vid><type>plugin</type><language>en</language><title>SHOUTcast</title><uid>34</uid><status>1</status><created>1330234373</created><changed>1330234373</changed><comment>2</comment><promote>1</promote><sticky>0</sticky><tnid>0</tnid><translate>0</translate><uri>http://www.serviidb.com/rest/node/106</uri></item></result>


If you then take the <uri> </uri> field and use it like below.

  Code:
http://serviidb.com/rest/node/106.xml


you get the following

  Code:
<?xml version="1.0" encoding="utf-8"?>
<result><vid>123</vid><uid>34</uid><title>SHOUTcast</title><log></log><status>1</status><comment>2</comment><promote>1</promote><sticky>0</sticky><ds_switch></ds_switch><nid>106</nid><type>plugin</type><language>en</language><created>1330234373</created><changed>1330234373</changed><tnid>0</tnid><translate>0</translate><revision_timestamp>1330234373</revision_timestamp><revision_uid>34</revision_uid><field_name><und is_array="true"><item><fid>32</fid><display>1</display><description></description><uid>34</uid><filename>shoutcast.groovy</filename><uri>public://Create Plugin/shoutcast.groovy</uri><filemime>application/octet-stream</filemime><filesize>2943</filesize><status>1</status><timestamp>1330234373</timestamp><rdf_mapping/></item></und></field_name><field_revision><und is_array="true"><item><value>1</value></item></und></field_revision><field_body/><field_plugins><und is_array="true"><item><tid>60</tid></item></und></field_plugins><rdf_mapping><rdftype is_array="true"><item>sioc:Item</item><item>foaf:Document</item></rdftype><title><predicates is_array="true"><item>dc:title</item></predicates></title><created><predicates is_array="true"><item>dc:date</item><item>dc:created</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></created><changed><predicates is_array="true"><item>dc:modified</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></changed><body><predicates is_array="true"><item>content:encoded</item></predicates></body><uid><predicates is_array="true"><item>sioc:has_creator</item></predicates><type>rel</type></uid><name><predicates is_array="true"><item>foaf:name</item></predicates></name><comment_count><predicates is_array="true"><item>sioc:num_replies</item></predicates><datatype>xsd:integer</datatype></comment_count><last_activity><predicates is_array="true"><item>sioc:last_activity_date</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></last_activity></rdf_mapping><cid>0</cid><last_comment_timestamp>1330234373</last_comment_timestamp><last_comment_name/><last_comment_uid>34</last_comment_uid><comment_count>0</comment_count><name>Xmantium</name><picture>0</picture><data>a:1:{s:7:"contact";i:1;}</data></result>


If you use <filename>shoutcast.groovy</filename> as below you can get the file information.
  Code:
http://www.serviidb.com/rest/file?parameters[filename]=shoutcast.groovy


This will return the following.

  Code:
<?xml version="1.0" encoding="utf-8"?>
<result is_array="true"><item><fid>32</fid><uid>34</uid><filename>shoutcast.groovy</filename><uri>http://www.serviidb.com/rest/file/32</uri><filemime>application/octet-stream</filemime><filesize>2943</filesize><status>1</status><timestamp>1330234373</timestamp></item></result>


if you use <uri>http://www.serviidb.com/rest/file/32</uri> as below you can get the download link to the file.

  Code:
http://www.serviidb.com/rest/file/32.xml


which gives the following.
  Code:
<?xml version="1.0" encoding="utf-8"?>
<result><fid>32</fid><uid>34</uid><filename>shoutcast.groovy</filename><uri>public://Create Plugin/shoutcast.groovy</uri><filemime>application/octet-stream</filemime><filesize>2943</filesize><status>1</status><timestamp>1330234373</timestamp><rdf_mapping/><uri_full>http://www.serviidb.com/sites/default/files/Create%20Plugin/shoutcast.groovy</uri_full><target_uri>Create Plugin/shoutcast.groovy</target_uri><file>aW1wb3J0IGdyb292eS5qc29uLkpzb25TbHVycGVyDQoNCmltcG9ydCBncm9vdnkuanNvbi5Kc29uU2x1cnBlcg0KDQppbXBvcnQgb3JnLnNlcnZpaW8ubGlicmFyeS5tZXRhZGF0YS4qDQppbXBvcnQgb3JnLnNlcnZpaW8ubGlicmFyeS5vbmxpbmUuKg0KaW1wb3J0IG9yZy5zZXJ2aWlvLnV0aWwuKg0KDQovKioNCiAqIFdlYlJlc291cmNlIGV4dHJhY3RvciBwbHVnaW4gZm9yIHNob3V0Y2FzdC5jb20uDQogKiANCiAqIEBhdXRob3IgamhiNTANCiAqDQogKi8NCmNsYXNzIFNob3V0Y2FzdCBleHRlbmRzIFdlYlJlc291cmNlVXJsRXh0cmFjdG9yIHsNCgkNCglmaW5hbCBWQUxJRF9GRUVEX1VSTCA9ICdeKD86aHR0cD86Ly8pPyg/Ond3d1xcLik/c2hvdXRjYXN0XFwuY29tLycNCgkNCglTdHJpbmcgZ2V0RXh0cmFjdG9yTmFtZSgpIHsNCgkJcmV0dXJuICdTaG91dGNhc3QnDQoJfQ0KCQ0KCWJvb2xlYW4gZXh0cmFjdG9yTWF0Y2hlcyhVUkwgZmVlZFVybCkgew0KCQlyZXR1cm4gZmVlZFVybCA9PX4gVkFMSURfRkVFRF9VUkwNCg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</file><image_styles/></result>


If you use the <uri_full>http://www.serviidb.com/sites/default/files/Create%20Plugin/shoutcast.groovy</uri_full> from above you can download the file.

  Code:
http://www.serviidb.com/sites/default/files/Create%20Plugin/shoutcast.groovy


OK now we have the plugin downloaded, now we can work on the media_resources

if you use the following you will get all the media_resources in the database. This one should give a big list of all the media resources. (yes resources is spelled wrong, will fix when I figure out how)
  Code:
http://www.serviidb.com/rest/node?parameters[type]=media_recourse


This is the format of the results.
  Code:
<?xml version="1.0" encoding="utf-8"?>
<result is_array="true"><item><nid>101</nid><vid>116</vid><type>media_recourse</type><language>und</language><title>One HD</title><uid>34</uid><status>1</status><created>1330037863</created><changed>1330037863</changed><comment>2</comment><promote>1</promote><sticky>0</sticky><tnid>0</tnid><translate>0</translate><uri>http://www.serviidb.com/rest/node/101</uri></item><item><nid>99</nid><vid>114</vid><type>media_recourse</type><language>und</language><title>HD Sports</title><uid>34</uid><status>1</status><created>1330024899</created><changed>1330024942</changed><comment>2</comment><promote>1</promote><sticky>0</sticky><tnid>0</tnid><translate>0</translate><uri>http://www.serviidb.com/rest/node/99


If you use the <uri>http://www.serviidb.com/rest/node/101</uri> from above you can get the detailed information on the resource.

  Code:
http://www.serviidb.com/rest/node/101.xml


which gives the following information.
  Code:
<?xml version="1.0" encoding="utf-8"?>
<result><vid>116</vid><uid>34</uid><title>One HD</title><log></log><status>1</status><comment>2</comment><promote>1</promote><sticky>0</sticky><ds_switch></ds_switch><nid>101</nid><type>media_recourse</type><language>und</language><created>1330037863</created><changed>1330037863</changed><tnid>0</tnid><translate>0</translate><revision_timestamp>1330037863</revision_timestamp><revision_uid>34</revision_uid><field_media_id><und is_array="true"><item><value>One HD</value><format/><safe_value>One HD</safe_value></item></und></field_media_id><field_url><und is_array="true"><item><value>https://sites.google.com/site/serviiorss/LiveFeeds_One_HD.rss </value><format/><safe_value>https://sites.google.com/site/serviiorss/LiveFeeds_One_HD.rss </safe_value></item></und></field_url><field_language/><field_cateegory><und is_array="true"><item><tid>13</tid></item></und></field_cateegory><field_region/><field_media_source><und is_array="true"><item><tid>5</tid></item></und></field_media_source><field_media_type><und is_array="true"><item><tid>15</tid></item></und></field_media_type><field_rating/><field_reliability/><field_thumbnail/><field_resolution><und is_array="true"><item><tid>25</tid></item></und></field_resolution><field_site_url><und is_array="true"><item><value>http://live.1hd.ro</value><format/><safe_value>http://live.1hd.ro</safe_value></item></und></field_site_url><field_media_description><und is_array="true"><item><value>The On-line Arts and Entertainment Network Featuring Classics, Dance, Jazz, Live, Pop and Rock Channels.</value><format/><safe_value>The On-line Arts and Entertainment Network Featuring Classics, Dance, Jazz, Live, Pop and Rock Channels.</safe_value></item></und></field_media_description><meta_abstract/><meta_keywords/><meta_description/><field_plugin_revision/><field_plugins><und is_array="true"><item><tid>53</tid></item></und></field_plugins><field_pluginname/><rdf_mapping><rdftype is_array="true"><item>sioc:Item</item><item>foaf:Document</item></rdftype><title><predicates is_array="true"><item>dc:title</item></predicates></title><created><predicates is_array="true"><item>dc:date</item><item>dc:created</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></created><changed><predicates is_array="true"><item>dc:modified</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></changed><body><predicates is_array="true"><item>content:encoded</item></predicates></body><uid><predicates is_array="true"><item>sioc:has_creator</item></predicates><type>rel</type></uid><name><predicates is_array="true"><item>foaf:name</item></predicates></name><comment_count><predicates is_array="true"><item>sioc:num_replies</item></predicates><datatype>xsd:integer</datatype></comment_count><last_activity><predicates is_array="true"><item>sioc:last_activity_date</item></predicates><datatype>xsd:dateTime</datatype><callback>date_iso8601</callback></last_activity></rdf_mapping><webform><confirmation></confirmation><confirmation_format/><redirect_url>&lt;confirmation&gt;</redirect_url><teaser>0</teaser><block>0</block><allow_draft>0</allow_draft><auto_save>0</auto_save><submit_notice>1</submit_notice><submit_text></submit_text><submit_limit>-1</submit_limit><submit_interval>-1</submit_interval><total_submit_limit>-1</total_submit_limit><total_submit_interval>-1</total_submit_interval><status>1</status><record_exists></record_exists><roles is_array="true"><item>1</item><item>2</item></roles><emails/><components/></webform><cid>0</cid><last_comment_timestamp>1330037863</last_comment_timestamp><last_comment_name/><last_comment_uid>34</last_comment_uid><comment_count>0</comment_count><name>Xmantium</name><picture>0</picture><data>a:1:{s:7:"contact";i:1;}</data></result>


If you look at the last results you will see the following
  Code:
<field_plugins><und is_array="true"><item><tid>53</tid></item></und></field_plugins>

The above tells that it is a livefeeds

  Code:
<?xml version="1.0" encoding="utf-8"?>
<result is_array="true"><item><tid>53</tid><vid>14</vid><name>LiveFeeds</name><description></description><format>php_code</format><weight>0</weight><language>und</language><i18n_tsid>0</i18n_tsid><uri>http://www.serviidb.com/rest/term/53</uri></item></result>
Last edited by moltra on Wed Feb 29, 2012 7:23 pm, 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
<<

kairoh

DLNA master

Posts: 180

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Wed Feb 29, 2012 9:43 am

Re: serviidb.com

I'm sorry and don't wanna be rude but this is not REST...
URL should be meaningful and should link to a unique resource (which could have different representation).

In your example, this URL
  Code:
http://www.serviidb.com/rest/node/{id}.xml
is not meaningful (what is a node?) and links to either a plugin or a media:
  Code:
http://www.serviidb.com/rest/node/106.xml => give plugin info
http://www.serviidb.com/rest/node/101.xml => give media info


Concerning <tid>, I think clients shouldn't know about them, as they're for server use only.
It may be "dangerous" to expose all resource; for example what will give this url ?
  Code:
http://www.serviidb.com/rest/node/42.xml


Maybe you could adapt the REST client of the phpwebui as a server.
Furthermore you may have a look to this small php rest tutorial and some REST frameworks.
"Tonic" and "Epiphany" seem really cool and easy (my first choices, cause I don't like Zend Frameworks).

Good luck!
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
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 Wed Feb 29, 2012 12:07 pm

Re: serviidb.com

In the content management system [url]www.drupal.org/url] This is the way they have setup REST. A node is one piece of content. I have looked at an external rest trying to use the one that is for drupal currently. What I think I need to do is edit the node_resource.inc module of drupal and customize it to return only the information that I am wanting while using better search terms.

  Code:
Version 3
Services 3.0 is now available. Read up on it here.If you want to know more about the new REST server, read here. Note that currently there is no upgrade path for Services 3, and it is not backwards compatible with older implementations of the API. Therefore some existing modules like JSON Server and AMFPHP will not work with it. Fear not, newer AMFPHP modules are in development, and REST Server and JSON Server are no longer needed because response formats have been rolled into Services Core.

Features(3.x):
Service API allow modules to create other services, including pluggable access control
Server API allow modules to create other servers, such as SOAP
Aliasing methods
Integration with core Drupal functionality like files, nodes, taxonomy, users, files and more.
Response format API allows you to define response Formats for CONTENT-TYPE ie. application/json or application/xml. (also calls such as ENDPOINT/node/1.json work)


  Code:
Project Information

Maintenance status: Actively maintained
Development status: Under active development
Reported installs: 12351 sites currently report using this module. View usage statistics.
Automated tests: Enabled
Last modified: January 20, 2012
Last edited by moltra on Wed Feb 29, 2012 12:36 pm, 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
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Feb 29, 2012 12:28 pm

Re: serviidb.com

Agree with kairoh. I was wondering why using Drupal... I guess it's easier to setup the forms and stuff, but will make it harder to write the API and tweek it to your needs. A php/mysql simple web app would work better in my opinion.
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Wed Feb 29, 2012 12:51 pm

Re: serviidb.com

I think the capability is there, I am currently using the basic module to return the data. I am looking at customizing the module, so it only gives back what is needed and allows a better search function. If I can change the fields returned when I do a search it will eliminate about 90% of my prior post.
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 Wed Feb 29, 2012 7:26 pm

Re: serviidb.com

I think I have a better clue now, I was relying on a 3rd party module to pull the data from drupal. I have now setup tonic as an external restful server and will be getting the data directly from the database, and doing all the calculations on the server so a easy clean xml will be delivered. I am going to try and have the part to get the plugin's done by tomorrow morning.
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 Thu Mar 01, 2012 9:49 am

Re: serviidb.com

OK I have the restful setup for retrieving the list of plugins from the database.

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


gives the basic results below. Do you guys want any certain return format? xml?

  Code:
Blip TV
CBS[code][/code]
iPlayer (UK)
4oD (UK)
YouTube
LiveFeeds
GameSpot
GameTrailers
CNN
Hulu (US)
Trailer Addict
SHOUTcast


I am still working on the rest resource to get the feeds for a plugin. What I have so far is below. I am working on getting the ability to add the plugin name as a parameter. The below resource is hard coded right now to get the 4od (UK) feeds.

  Code:
http://serviidb.com/api/task/feed


Which gives.

  Code:
Title: 4oD (UK)
Title: Coppers
Title: Big Fat Gypsy Weddings
Title: 90210
Title: Skins
Title: Shameless
Title: New Girl
Title: Desperate Housewives
Title: Homeland
Title: The Cleveland Show
Title: Hollyoaks
Title: One Born Every Minute
Title: Playing It Straight
Title: 10 O'Clock Live
Title: Come Dine With Me
Title: Daddy Daycare
Title: The Good Wife
Title: The Hotel
Title: Confessions Of A Nurse
Title: SuperScrimpers
Title: Coach Trip
Title: Amish: World's Squarest Teenagers
Title: The Inbetweeners
Title: The Big C
Title: Meet Ricky Gervais
Title: Deal Or No Deal
Title: Rules Of Engagement
Title: 8 Out Of 10 Cats
Title: Fresh Meat
Title: How To Cook Like Heston
Title: Countdown
Title: Educating Essex
Title: Location, Location, Location
Title: Phil Spencer: Secret Agent
Title: Jamies 30 Minute Meals
Title: Undercover Boss
Title: KOTV Boxing Weekly
Title: Grand Designs
Title: Embarrassing Bodies
Title: Hestons Feasts
Title: Four In A Bed
Title: The IT Crowd
Title: Dispatches
Title: Supersize VS Superskinny
Title: The Joy of Teen Sex
Title: Saving Grace
Title: Facejacker
Title: Ramsays Kitchen Nightmares USA
Title: Fonejacker



I will be adding the download link for the plugin, and the url for the feeds.
Any certain way you guys want it return 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 Thu Mar 01, 2012 10:00 am

Re: serviidb.com

moltra wrote:gives the basic results below. Do you guys want any certain return format? xml?


I will want JSON either via a header or by adding something to the end of the URL.
Will

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

kairoh

DLNA master

Posts: 180

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Fri Mar 02, 2012 10:58 pm

Re: serviidb.com

+1 for JSON ;)
And maybe some XML (by altruism :P ).

Tonic seems to support multiple representation via header and uri (by annotation).
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
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 Mar 04, 2012 1:05 am

Re: serviidb.com

I have added a support ticket system on the site, please enter a support ticket with any new feature requests, or changes that you would like to see. I will use these tickets to keep everyone informed with my progress on the site.
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 Mon Mar 05, 2012 3:52 am

Re: serviidb.com

I have a question for the users that do not speak english as a native language. I am trying to setup serviidb.com as a multi-lingual site, but I am not sure if that will help alot. Since alot of the content and the urls are custom, I cannot do autotranslate. How would you guys like to see it. Would you like to enter it in the language for the region that the online feed is viewed in?

In otherwords I need feedback on how to make serviidb more usable for the users I see looking at the site. I can add google translate API to the site, but it is $20 per million charaters translated, and I am not sure if it would try and translate urls which would cause them to stop working.
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 Mar 06, 2012 4:52 am

Re: serviidb.com

Serviidb is down right now for updating the software. Should be back online tomorrow.

Site Backup, going to do a complete reload on the software in a couple of days, all data will be retained.
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 Thu Mar 15, 2012 2:58 am

Re: serviidb.com

If everything goes right, I should have the restful server online tomorrow evening.

the restful command will be like below. All commands will be able to be returned in any of the three formats json, xml. html.

  Code:
http://serviidb.com/api/video.json?client=serviidroid
=> return every video feed in json

http://serviidb.com/api/audio.xml?client=webui
=> return every audio feed in xml

http://serviidb.com/api/plugins.xml
=> return every plugin in xml

http://serviidb.com/api/video.json?region=UK&plugin=youtube
=> return video feed in json, filtered by region and plugin

http://serviidb.com/api/video.json?region=UK&title=csi
=> return video feed in json, filtered by region and title


I am also working on the following (trying to determine how much security I need to setup)

  Code:
http://serviidb.com/api/user.json?user=moltra

=> return bookmarked feeds by the user in json. The user will be able to bookmark feeds, and rss files on serviidb.com and will be able to download them via the clients using this.

I am also setting up
  Code:
http://serviidb.com/api/added?client=webui&title=csi
that will update a counter in the database showing that "CSI" was added to a serviio server using the webui.

I am using the client to log how many times each client is used. I know we have multiple web UI's and need to decide on a client name to tell them apart.

I will be posting documentation on the setup and fields of the restful service when it is active.
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
<<

kairoh

DLNA master

Posts: 180

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Thu Mar 15, 2012 9:47 am

Re: serviidb.com

Looks very nice! 8-)
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
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
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Mar 15, 2012 9:47 am

Re: serviidb.com

looking good. it it possible to filter by URL? you have plugin, so I assume all youtube videos you can get that way, but what about sites that have to plugins but have many feeds to search through?
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Mar 15, 2012 2:12 pm

Re: serviidb.com

Yes I can setup a wildcard search of the URL. Like every URL that contains "cat" along with the region, plugin...
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 Thu Mar 15, 2012 8:00 pm

Re: serviidb.com

I am setting up the plugin.json to look something like below. Let me know if you guys would like anything changed. One thing that I noticed is that it is returning all versions of the plugin in the database. Do we want that or only the post current one?

  Code:
["Blip TV","0","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/BlipTVUrlExtractor.groovy\n"]["CBS","0","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/CBS.groovy\n"]["iPlayer (UK)","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/IPlayer.groovy\n"]["4oD (UK)","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/Channel4od.groovy\n"]["YouTube","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/youtube.groovy\n"]["LiveFeeds","3","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/livefeeds.groovy\n"]["GameSpot","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/gamespot.groovy\n"]["GameTrailers","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/gametrailers.groovy\n"]["CNN","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/cnn.groovy\n"]["Hulu (US)","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/hulu.groovy\n"]["Hulu (US)","1","http:\/\/serviidb.com\/sites\/default\/files\/Hulu.groovy\n"]["Hulu (US)","1","http:\/\/serviidb.com\/sites\/default\/files\/create plugin\/Hulu_0.groovy\n"]["Trailer Addict","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/traileraddictrss.groovy\n"]["SHOUTcast","1","http:\/\/serviidb.com\/sites\/default\/files\/Create Plugin\/shoutcast.groovy\n"]["None","0","http:\/\/serviidb.com\/sites\/default\/files\/\n"]
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 Thu Mar 15, 2012 8:26 pm

Re: serviidb.com

Where are the field names?

I would have expected something like this
  Code:
{"plugins":[{"name":"Blip TV", "version":0, "url":"http:\\serviidb.com/sites/default/files/Create Plugin/BlipTVUrlExtractor.groovy"},{"name":"CBS", ....}]}


which would then be mapped to something like this
  Code:
List<PluginDescription> plugins;

class PluginDescription {
   String name;
   int version;
   String url;
}


If you are going to return multiple versions, then something like the following so that they are associated with the same plugin name.
  Code:
List<PluginDescription> plugins;

class PluginDescription {
   String name;
   List<PluginVersion> versions;
}

class PluginVersion {
   int version;
   String url;

}

and in json
  Code:
{"plugins":[{"name":"Blip TV", "versions":[{"version":0, "url":"http:\\serviidb.com/sites/default/files/Create Plugin/BlipTVUrlExtractor_0.groovy"}, {"version":1, "url":"http:\\serviidb.com/sites/default/files/Create Plugin/BlipTVUrlExtractor_1.groovy"}],{"name":"CBS", ....}]}


The only reason to present multiple versions is if one was updated to support a new feature in serviio and would fail to run on an older version of serviio, but the old version of the plugin still works in an older version of serviio. In which case you would also need a minServiioVersion field.


It would be nicer if the plugin url didn't contain a space :)
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 16, 2012 1:16 am

Re: serviidb.com

I am working on getting the field names there. I will adjust the way the files are stored to get rid of the space. The versioning we all need to figure out how we are going to handle that.
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 Mar 17, 2012 5:42 pm

Re: serviidb.com

I got the field names in there, but still cannot figure out how to get the "plugins" at the front. I also got rid of the space in the file name.

  Code:
{"name":"Blip TV","version":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/BlipTVUrlExtractor.groovy"}{"name":"CBS","version":"0","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/CBS.groovy"}{"name":"iPlayer (UK)","version":"1","URL":"http:\/\/serviidb.com\/sites\/default\/files\/createplugin\/IPlayer.groovy"}


Here is my php code any and all help would be appreciated.

  Code:
<?php
 
class TaskDataManager {
   
   public static function get($taskId, $input){
echo $taskid . "\n";      
//Connect To Database
$hostname=;
$username=;
$password=;
$dbname=;


mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
//echo 'taskid: ' . $taskId . "\n";

   
   if($taskId=="plugins"){
      //echo $input . "\n";
                //the following line appends the full url to the information stored in the mysql database.
      $plgnsql='SELECT taxonomy_term_data.name, field_revision_field_revision.field_revision_value as version, file_managed.uri as URL'
        . ' FROM taxonomy_term_data '
        . ' left join field_data_field_plugins on taxonomy_term_data.tid = field_data_field_plugins.field_plugins_tid '
        . ' left join field_revision_field_revision on field_revision_field_revision.revision_id = field_data_field_plugins.revision_id '
        . ' left join file_usage on field_data_field_plugins.entity_id = file_usage.id'
        . ' left join file_managed on file_usage.fid = file_managed.fid'
        . ' WHERE (field_data_field_plugins.bundle ="plugin")'
        . ' ';       


      //$format='json'

      $result = mysql_query($plgnsql);
      //$mark =jsob_encode("plugins");   
      
      $plugins = array();
            
      //echo $result . "\n";
      
         //$response->addHeader('Content-type', 'application/json');
         
         while($response = mysql_fetch_array($result, MYSQL_ASSOC)){
                           
                           
                           
                           $response[URL] = substr_replace($response[URL],'http://serviidb.com/sites/default/files/',0,9);
                           $reponse = json_encode($response);
                           print_r  ($reponse) . "\n";
                        }   
                           //print_r  ($response) . "\n";
                           
                           
                        
                        
      return true;
   }   
   
   if($taskId=="feed"){
   
         return true;
   }   
   }
}

?>
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 3 guests

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