I've created a Zoopy provider file for both the 5.x and 6.x version of emfield. Zoopy (http://www.zoopy.com/) is a South African social media sharing site.
The way I've done it here is by no means elegant - any suggestions at how to improve this are welcome - I see this as a good opportunity to learn and improve ;-)
A couple of issues I know of:
Zoopy does not currently provide the video info as xml, only JSON, so I was not able to use the emfield_request_xml function to retrieve data. I had to do this using my own function (zoopy_get_json_data) and I have to call it an extra time to get the thumbnail, so it's not that efficient.
I've hard-coded the last part of the thumbnail url as this is not provided in the JSON data - if Zoopy changes this, then the thumbnail won't work.
In the function zoopy_get_json_data I also hard-code the oembed JSON url (although the video URL is obviously not hard coded). I'd like to be able to automatically extract this from the page source.
Lastly, for those still on PHP < 5.2 you'll need to include an extra file as we use the php function json_decode which is only available in PHP versions 5.2 or greater. I put this file in a folder called php_scripts in my theme folder. If you want to put this file somewhere else you'll have to change this path in the function zoopy_get_json_data.
I've attached both D5 and D6 versions to this post, as well as the extra file you'll need if you're not on PHP 5.2 or greater.
I understand that zoopy are working on a public api, so I'll update these files when the api comes out.
| Comment | File | Size | Author |
|---|---|---|---|
| JSON-for-PHP-less-than-5-2.zip | 7.13 KB | foxtrotcharlie | |
| zoopy-6-x-1-0.zip | 3.67 KB | foxtrotcharlie | |
| zoopy-5-x-1-0.zip | 4.26 KB | foxtrotcharlie |
Comments
Comment #1
foxtrotcharlie commentedI meant to say - work on this was sponsored by SANGONET, for their website NGO Pulse.
Comment #2
foxtrotcharlie commentedFor instructions on how to use and install, see: http://www.parkroad.co.za/node/155
Comment #3
neil_garb commentedIn addition, you can check out our REST API documentation at http://www.zoopy.com/docs/api/rest. Feel free to send any feedback/comments/bugs to api@zoopy.com.
Comment #4
alex ua commentedThis should be created as it's own module. http://drupal.org/project/media_hulu or http://drupal.org/project/media_viddler for examples.