How to get youtube embed code with CodeIgniter? - codeigniter

I need to give the possibility to embed youtube videos in a website I'm developing. The admin shoud be able to insert a youtube link in a form; the url will be stored in the database and then I have to embed it in a page.
I was trying to use this library: http://codeigniter.com/wiki/YouTube_API_for_CodeIgniter/revision/12072/
But using the getVideoEntry function I get this, and I don't really know what to do with it:
tag:youtube.com,2008:video:zol2MJf6XNE2009-01-14T17:21:57.000Z2011-09-01T11:36:39.000ZSyndication of this video was restricted by its owner.DominoRecordshttp://gdata.youtube.com/feeds/api/users/dominorecordsMusicDominoRecordsA video for 'My Girls' from Animal Collective's new album Merriweather Post Pavilion. Out now on Domino. Produced by: Knowmore Productions Animated by: Jon Vermilyea Edited/VFX by: Chad Von Nauanimal collective, my girls, domino, avey tare, panda bear, geologistDEAnimal Collective - My Girls (2009)widescreen2009-01-14T17:21:57.000Zzol2MJf6XNE
And anyway, to use it, I need the youtube video id. Is there an easy way to get it, which covers all possible variations of youtube urls?

CodeIgniter seems like overkill for merely embedding videos. The YouTube functionality on the page you linked is mostly a wrapper for the YouTube Data API (which allows for extracting information about YT users, channels, videos, etc. and facilitates procedural uploading of videos). Embedding videos is as easy as dropping some HTML on your page with the correct video ID.
Here's the best answer I've seen for getting the video ID from URLs.

Related

How to Only Show Video in Instagram Embed Code?

I am using Laravel 5 and My client wants me to set and input in his admin page to add embedded Instagram videos code.
But does not want to show title, likes and other information.
Just plain video with autoplay.
I found out that you can just eliminate those pieces in the code Instagram gives you but my client just want to copy-paste.
Is there a way around this?

How to use YouTube Data API (v3) to get more than 15 videos in an RSS reader (newsboat)?

I was wondering if you could pull more than 15 videos from a youtube channel's RSS feed (I'm using newsboat with a macro to open mpv to play the videos from the links but that's unlikely to make a difference, any RSS reader and media player that can use links should suffice for this). The default URL of https://www.youtube.com/feeds/videos.xml?channel_id=CHANNELID only gives the 15 more recent videos. I found this question: Fetching videos list from a Youtube playlist through RSS doesn't return more than 15 results and the user KENdi says to use the Google-Data-API (v3) and use the command "PlaylistItems: list" with documentation located here: https://developers.google.com/youtube/v3/docs/playlistItems/list to theoretically pull as many as 50 videos.
I have no idea what is meant by this. How do you actually apply this knowledge in practice? All I have access to is newsboats' ~/.newsboat/urls file to add links with tags to the menu so where would I actually add an implementation of some API call and would it normally give me the link so that I can play it in mpv straight from newsboat?

Direct URL to "I'm Feeling Lucky" for images

I have a website for book reviews. I offer a link to the Amazon entry of the books. I discovered after a bit of research that the direct URL for Google's "I'm Feeling Lucky" is:
http://www.google.com/search?hl=en&q=TITLE+AUTHOR+amazon&btnI=745
Which works magic because then I don't have to manually include the Amazon link in my database and directly links to the Amazon page (works 99.99% of the times).
I was wondering if there was an equivalent for images (whether Google or some alternative) to retrieve an image URL based on keywords only (for the purpose of getting the book cover image).
There's no such thing for Google Images, but you might be able to use another web service to do what you want. I noticed that when you're searching for a book, the first image result isn't always the cover of it. Sometimes it's a photo of the author, sometimes it's some image from book's review, so you can hardly rely on that.
It should not be hard to parse the amazon page and get the image and link but google has an API to google books that return all informations about a book in JSON format, you can try it online on the API Explorer (the cover are on the results too). Click here to see an example (click "Execute" to run it).
Unfortunately public Google search engine doesn't support that. You should use Custom Search API to implement such feature in your application. Alternatively use XGoogle (unofficial Python wrapper to Google Search services, see google_dl tool for example).
Other suggestions is to use:
YQL by Yahoo (see yql-tables repo at GitHub for examples).
Use alternative search engines.
E.g. In Wolfram Alpha you can type: "show image of laptop" and it'll give you the first popular picture, however you need to use Wolfram|Alpha APIs or some script (see this ChatBot for example) to pick up the direct link.

Social Plugins for Facebook Photos and Albums

Is it possible to use Social Plugins such as the Comments and Like plugins to display the comments and likes for a photo or album uploaded to Facebook?
I have tried various URLs for the HREF attribute (the photo source, the photo page, the graph URL, etc) and cannot get the plugin to display existing comments against the photo. Can someone suggest the correct URL (if any) that I should use?
I can get access to the list of comments using the graph API, however I would prefer to make use of the social plugins if possible.
Currently you can not use them in that manner. You can use the graph api to read and write comments, read and add albums and photos.
https://developers.facebook.com/docs/reference/api
This is somewhat involved and requires knowledge of coding.
I personally have been working on a Feed for the wall, and for albums and have to say it was no easy task. https://apps.facebook.com/AnotherFeed

Download Images from wikipedia by Music Category and Handling Updates

I am trying to get Music Artist images and Album Art information from Wikipedia. Has anyone tried this before?
I searched around and found few links with relevant information
http://commons.wikimedia.org/w/index.php?title=Special:Search&ns0=1&ns6=1&ns12=1&ns14=1&ns100=1&ns106=1&redirs=0&search=buitenzorg&limit=10&offset=0 - search images for buitenzorg
http://www.mediawiki.org/wiki/API:Allimages - All images API call to fetch image urls from wiki
But could not find a way to download all the images from Music category and run deltas for updates after the initial download. Any pointers to the solution will be helpful.
I searched everywhere and finally I went with below mentioned implementation.
Here's the api documentation: http://www.mediawiki.org/wiki/API:Main_page
Call wikipedia API for artist page
Look at the player card info given on the right, and get the image name.
Make another wikimedia call to get Image download url.
Download the actual image.
For deltas, the only way is to hit wikipedia APIs again with image name and check for updates.
The other work around for this is setting your own wikimedia server, which will handle deltas.
See here http://www.mediawiki.org/wiki/Manual:Installation_guide

Resources