How to extract the full content from a partial content rss - php

I am working on a PHP project. The goal (in a simple lang) is to read an RSS feed, and get the title, full content, and media (video and/or images) from it, and post it in a wordpress blog. (The customer wants to use some sources that are open for sharing and use them for auto posting in his blog)
I successfully could extract the title, content and images or videos and post them in wordpress. However, there are some problems:
1) I can only extract the media if they are included in the RSS.
2) I cannot extract the full text of the content if the RSS is a partial content RSS.
So, is there any solution to be able to access the original content from RSS and extract the full text content and media if available?

The RSS provider decides if the full text is exported or not. So if it exports just the partial content, you may have to get the full content of the link by curl(or others) and try to figure out where the full content is.

If you provide a link to the rss feed I will update my answer to tell you precisely. This can only be determined on a case by case. An example of a reader can be found here http://www.w3schools.com/php/php_ajax_rss_reader.asp obviously with modern techniques you can do a lot better.

Related

get URL from XML enclosure

http://paultan.org/feed/
In above feed I can get the img ur like http://s2.paultan.org/image/2014/12/Theo-top-10-fave-renders-108x108.jpg
but in feedly.com I'm seeing other link of image, which have bigger size. I wonder how feedly can retrieve the 's content since it's not in the feed's DOM.
Would this link represent the large image that you see?
http://s1.paultan.org/image/2014/12/top-10-posts.jpg
feedly.com may be reading the destination page once and save it in their database. From the header you have a Facebook entry as follow:
<meta content="http://s1.paultan.org/image/2014/12/top-10-posts.jpg"
property="og:image">
which feedly.com would be using to present the image. This, of course, means a lot more bandwidth used in order to be able to display such information. They may also limit it to websites that have such headers (so they test once or twice, if the website does not offer a link like the og:image, they stop testing that website altogether, at least for a while...)

trigger audio .wav using php

Need advice, guidance on triggering a .wav file to play when a web page loads content and a specific keyword is within body of that content.
The content is being pulled from a Yammer network thru a custom app I created to look for certain hashtag messages using PHP. Now, I'd like to have a sound play (like a bell) when a specific hashtag has a new message. The bell would not ring a second time, just on the intial display.
Suggestions (using PHP)?
To play music in your site, place, <embed src="yourfile.wav"></embed> anywhere in page and checkout.
You can make it dynamic by using php in src.

How to implement a Facebook-like previewer

I was looking at how Facebook makes external websites previews given on a URL shared by the user. The result is not just a thumbnail but actual text, an embedded video or an image depending on the link given. For example, if you post a link from a Wikipedia article, it displays text. If you post the link of a video from Dailymotion, it embeds it.
Is there a PHP/Javascript-Ajax approach to accomplish this? Any specific library for this purpose?
If there isn't, what's the best way server-side (in PHP if possible) solution for web scraping and displaying a thumbnail preview?
Facebook does this by looking for Open Graph meta tags. In the case of embedded videos, it's looking for the og:video tag.
If there aren't OG tags, it'll make a best guess.

How do I turn a link into an image to embed?

I am attempting to create some functionality on beta.peaksneak.com where users can basically journalize. To do this I want them to be able to add images, videos, quotes, and links to a journal entry.
I found out that you can use oEmbed to embed videos, and images/quotes are easy.
Is there a script for embedding links and auto-capturing a large image from the link to use for embed purposes? For example, on Facebook, when I paste a link into a comment, it automatically generates an image and text (probably from meta tags and the first large image it can find).
You can also try https://github.com/starfishmod/jquery-oembed-all for your oembed stuff - it has a lot of providers and is client side only if that is what you are looking for?

How to generically create a thumbnail corresponding to a given RSS feed's article

So I'm brainstorming right now and would like to hear your thoughts on this.
So you know the news app, pulse?
As you can see it pulls thumbnails from virtually any news source.
I'm curious as to how they gather the title and image from various sources since their RSS feeds will always vary.
I was thinking, for each article in the RSS feed, I would just iterate over its content until I find a preg_match for an image source.
Is that the best way to generically determine the image?
..How about the title?
:)
The titles is obviously from the RSS. Look at any rss feeds for their title tags.
Probably the only tricky part is the thumbnail. However some RSS feeds like Engadget http://www.engadget.com/rss.xml;
has image associate with each article (under the CDATA of the description tag) which can be easily regex match.

Categories