Posting full articles from RSS feeds - php

How can this be done?
Now I use fulltextrssfeed.com and WP robot, but I don't really like it, because fulltextrssfeed.com posts only like 5 articles when it was more than 50 in the original RSS feed. And all the plugins I tested (FeedWordPress, RSS poster, WP-o-matic, WP robot) couldn't post full articles from every feed I used.

The feeds themselves don't contain the full text of the articles.
What fulltextrssfeed.com does is fetching the URL of the feed entry and extracting the full text from there. This is what you have to do, too - if you want all the articles

you can use http://www.feedsapi.com/ or http://fivefilters.org/content-only/

You can use the api provided by full post rss feed, which extracts 10 posts from the rss feed, it is basically hosted version of fiverfilter premium Api. Fivefilter regularly updates their templates to extract the content from the major themes and sites.
If it is not able to extract the rss feed from any site, then you can add the template for that site, that means, template is something which will provide the details of tags and class to extract the content. For example, In wordpress, mostly the content will start from article tag or Div tag with some class. If you know any one programing language, then you can write your own rss parser and full content extracter using curl or any other method. It is very simple, you need some bandwidth to understand the concept.

Related

Hide Gutenberg's Pullquote Block from RSS Feed in Wordpress

Brief explanation of our need: When we use a pullquote in a post we want it filtered out/hidden from the RSS feed, while at the same time continuing to show up in the content when viewing the post on the website.
Fuller explanation of our need: A pullquote highlights a specific piece of content from an article/page/post by repeating the content and bringing it slightly outside of the flow of the article/page/post content. This works well when using CSS, because it makes it clear that it is not to be read in the flow of the article's content, but to highlight a good sentence or two. Pullquotes are repeated content. However, in an RSS feed, the repeated content is awkward. We'd like to automatically filter out all pullquotes from our blog content on RSS feeds, while keeping it in the post content for frontend viewing.
What have I tried?
I've tried this plugin and it didn't work: https://wordpress.org/plugins/content-visibility-rss-feed/
I've read this, but don't know how to make it work for filtering pullquotes: Remove certain elements from an RSS feed such as short codes
I've read this, and while he outlines the problem well, we need a PHP solution and not a JS solution: https://css-tricks.com/better-pull-quotes/
I've read this stack overflow post, but we don't want to use custom fields: Hide/block page elements from RSS feed
A friend provided this code that I've tested, and it works well.
// Remove all Gutenberg pull quote blocks from feeds
function theme_filter_pull_quotes( $content ) {
return preg_replace('#<figure class="wp-block-pullquote(.*?)</figure>#', '', $content );
}
add_filter('the_content_feed', 'theme_filter_pull_quotes');
As you can see, the opening tag is not closed because depending upon your block settings, Wordpress may add other classes which would not match the pattern. Leaving the tag opened allows any additional classes to be included. It seems wp-block-quote is always the first class.

extract complete content of websites via feed in php

i want get complete content of a news or post of a website via feed. but we know that many websites only presents some part of news or post via their feed.
of course i know that exists a script called SimplePie that is developed for get content of websites via feed. but this script do not retrieve full content of a news.
of course i found a script called Full-Text Feeds that do It. but it is no free . i want a free script.
Do you know a similar script or way to do my need?
The code behind Five Filters' content extraction is actually open source, and is based on Readability's original Javascript (before they became a service).
You should be able to use it like this:
$page = file_get_contents($item_url);
$readability = new Readability($page);
if ($result = $readability->init()) {
$content = $readability->getContent()->innerHTML;
}
Not entirely sure what you're trying to do here but this might help you:
$full_page_content = file_get_contents('http://www.example.com/');
Edit: Ok, if I understand you correctly you'll need to do something like this:
Get rss feed
Use SimplePie or something like it to go through each feed item
For each item in RSS feed
Get the item's url
Get the content from that URL
Strip out the HTML/extract only the text you need
Combine all of these into a new RSS feed and send that to the user
Note: This isn't a simple thing to do. There is a reason that Full-Text RSS can charge for their product.
You could use http://magpierss.sourceforge.net/cookbook.shtml (free)
It retrieves RSS feeds. There are many many many PHP scripts that do that on the web... Google si your friend !! :)

RSS feed generation and implementation

I am a fresher to Rss feeds.
I have read some sites related to rss feed.But i didn't get full picture about it.
I understand that ,i need to create a xml for displaying my site contents as feed in another site.
For example
i have two php sites
www.site1.com
www.site2.com
And there is page feed.xml in site1.com, which has the latest feeds
Let me know , what are the general methods to display these feeds to other site www.site2.com
Also , where can i see the general format of xml used for rss
On www.site2.com
Fetch RSS using a RSS library from www.site1.com
Parse
Display
You can use Simplepie RSS library for this purpose. See http://simplepie.org
See HERE for the general format.
You can find PHP-RSS-Parsers HERE, HERE or HERE.

How do I extract the blog posts like this site did?

This site is built on Ning. You'll notice they have jQuery tabs set up on the home page and looking through the source code, you'll see that those tabs are getting their content from an outside url (below):
<div class="ui-tabs" id="tabs">
<ul>
<li>Features</li>
<li>Vip Blogs</li>
<li>All</li>
</ul>
</div>
However, those urls aren't standard to Ning (I've tried appending /vip/blog/embedPromoted?pageSize=10 on a similar Ning blog url and it didn't work) which leads me to believe that they were created separately somehow to extract just the blog posts. Here is what a blog page on Ning looks like for reference: link
Anybody have an idea of how they created these pages with just the blog posts? I originally thought of using the blog's rss feed but realized the rss doesn't include author avatars and certain post metadata information like how it is in the first link I posted above.
Any help would be hugely appreciated.
Thanks to all in advance!
The /vip URLs on that Ning site is a custom feature from when Ning used to host custom PHP code. Since it's a custom feature, it's not available on other sites.
It's possible to create something similar using the Ning API to aggregate blog content from a specific set of members into a single HTML page or RSS feed. It would have to be implemented on an external server.
Check out rssinclude.com, handy way to drop RSS feeds into a site.
If that won't work, you can use the QueryPath library to grab the HTML from the site jQuery style, but in PHP.
What do you mean by rss feeds don't include the author's avatar ? It is included in the link you have in your OP.
One way this could have been implemented is that they apply a XSLT temnplate to a RSS feed to build the HTML page .

How to create an RSS feed and display it?

On a website I am maintaining for a radio station they have a page that displays news articles. Right now the news is posted in an html page which is then read by a php page which includes all the navigation. I have been asked to make this into and RSS feed. How do I do this? I know how to make the XML file but the person who edits the news file is not technical and needs a WYSIWYG editor. Is there a WYSIWYG editor for XML? Once I have the feed how do I display it on my site? Im working with PHP on this site so a PHP solution would be preferred.
Use Yahoo Pipes! : you don't need programming knowledge + the load on your site will be lower. Once you've got your feed, display it on your site using a simple "anchor" with "image" in HTML. You could consider piping your feed through Feedburner too.
And for the freeby: if you want to track your feed awareness data in rss, use my service here.
Are you meaning that someone will insert the feed content by hand?
Usually feeds are generated from the site news content, that you should already have into your database.. just need a php script that extract it and write the xml.
Edit: no database is used.
Ok, now you have just 2 ways:
Use php regexp to get the content you need from the html page (or maybe phpQuery)
As you said, write the xml by hand and then upload it, but i havent tryed any wysiwyg xml editor, sorry.. there are many on google
Does that PHP site have a database back end? If so, the WYSIWYG editor posts into there then a special PHP file generates an RSS feed.
I've used the following IBM page as a guide and it worked wonderfully:
http://www.ibm.com/developerworks/library/x-phprss/
I decided that instead of trying to find a WYSIWYG for XML that I would let the news editor continue to upload the news as HTML. I ended up writing a php program to find the <p> and </p> tags and creating an XML file out of it.
You could use rssa.at - just put in your URL and it'll create a RSS feed for you. You can then let people sign up for alerts (hourly/daily/weekly/monthly) for free, and access stats.
If the HTML is consistent, you could just have them publish as normal and then scrape a feed. There are programatic ways to do this for sure but http://www.dapper.net/dapp-factory.jsp is a nice point and click feed scraping service. Then, use either MagpieRSS, SimplePie or Feed.informer.com to display the feed.

Categories