News Feeds
-
I cannot understand fully that :SIndication Feeds: means … I was run zFeeder on my server … but is there way to more organized way posting news feed on wordpress blog cause I found only one way to <include> … but this include appears on all pages in the blog …. can news feed looks like usual post
regards…
sorry for bad en.
-
I’m not sure if this is what you are after ?
https://www.chait.net/index.php?p=85Thanks for the link podz! ??
Yes, you can use something like CG-Feedread in order to aggregate news feeds into your site. It also has an option to try and make the feed look integrated into the site design as posts — though I need more testers/feedback to make it work better/look better.
You also have full control over WHEN to call the feed-showing code. For instance, you could have a feed that you only want to show when seeing posts of a given category, or only on your homepage, or in a ‘static page’ of your site that JUST shows feeds (I have a few users going that route…), as CGFR doesn’t actually depend on any WP code.
Feel free to post here if you need help!
-d
https://www.chait.netI cannot still understand ??
Wordpress has a strange language … and if I post – <include > tag in write form … there are nothing maybe I have to know how to edit pages that are generated like “p?=xx” but I think that’s not possibleNo no… If you downloaded Feedread, I think the instructions are pretty simple. They do assume you have just the slightest understanding of how the WP template file (index.php) is laid out.
You copy the contents of the feedread archive into your wp-content/plugins folder. Then go to the Admin screen for your blog, choose Plugins, and click Activate next to the CG-Feedread plugin (which should have been automatically found and thus listed).
Once activated, you can edit your template/index.php file to add feeds whereever you want them. Most people put simple title-only feeds into the MENU div section (the right sidebar of the default template).
for an example, I’ll walk you through index.php. look for the line:
<li id="other"><?php _e('Other:'); ?>
You want to insert the following code BEFORE that line:
<?php
$feedUrl = "https://news.com.com/2547-1_3-0-5.xml"; // cnet news as an example
$feedOut = parseURL($feedUrl, 4, false, "feed-cnet");
if (!empty($feedOut))
{
start_block("Feedread News", "feedread", "li");
echo $feedOut;
end_block();
}
?>
Obviously, you should change $feedUrl to be the URL of the newsfeed you want. And “feed-cnet” should be changed for each feed to reasonably identify the cached data from the feed (no special characters other than – and _ and . though).
Note that inside the wp-content/plugins/cg-plugins folder is a cache_rss folder; that stores cached copies of feeds (like ‘feed-cnet.dat’) so they only update from the net every 24h (or whatever time schedule you’d prefer). So if you change options, you’ll want to delete the cache files IN that folder (and NOT the folder itself), so that you can see your changes update live when you refresh the page — otherwise, you’d have to wait a day! ??
Did that help?
-d
CHAITGEARHey David. I installed your feedread plugin on my page, and everything is dandy. However, I would like to change the global $CACHE_TIME to something less than 24hours. How and where can I do that, and what syntax do I use?
You can see it at: https://www.publichealthcenter.comI am just getting my feedread running and from what I have seen it is very cool. IMHO davidchait’s widget has not had the wide recognition it deserves. Prolly because very few of us non techno folks understand it, But when I have seen other peoples running it is very very cool and the install looks straightfoward.
Thanks david & co. If it blows up we will let you know.David sent me th following in an email, just FYI:
I’m just about to release a brand-new version of Feedread, though this
applies to older versions as well.
At the top of my current version, is a line:
$XML_CACHE_TIME = 24 * 60 * 60; // hr * min/h * secs/m — you can change
this for faster updates of the caches.
You can change that line, or with the plugin you can simply override it in
index.php after the wp-blog-header include (as that brings in the plugins).
So, you could do something like:
$XML_CACHE_TIME = 30 * 60; // min * secs/m
If you wanted a 30min update. I don’t recommend really, really short
updates, just because you start to put a stress on the source servers. And,
I fudge the update time a bit anyway, so making it <15m probably isn’t very
useful.Root, would love to know what kind of things I could include to make it more usable by non-techies. Simpler examples? (I’m not sure they can get THAT much simpler…). Links to ‘What is RSS’ type pages, to explain syndicating/aggregating feeds in the first place?
-dDavid! I love you! I’ve been trying to integrate feeds into a new site and just found your power pack, thanks so much! ??
Hopefully you can help me tweak this slightly…
Here’s the code I’m trying to get working, I have it inside the wp post loop:
<?php
//$feedUrl = "the_excerpt_rss()"; // feed URL
$feedOut = getSomeFeed('the_excerpt_rss()', 4, false, the_ID(), '', 36, false);
if ($feedOut)
echo $feedOut;
echo "<P>Feed Location: "; the_excerpt_rss();
?>
You may know by looking at this, but the problem is I can’t get it to accept the_excerpt_rss() as a feed URL. (I know I have the $feed = commented out right now, still trying variations) Anyway, I’ve tried it with single and double quotes (as you see here), and without.
When I DON’T have quotes in place, the feed URL shows properly in the echo statement but your feedreader gives errors. When I do have single or double quotes in place, I get “the_excerpt_rss()” verbatim.
I want to be able to do this:
1. Create a new post with a feed name/subject/title
2. Put the feed RSS/XML URL into the excerpt field
3. Have the post page (single) automatically parse/display the feed
4. Have the cache file named with either the post title or post ID
Any ideas on how I can tweak your code to allow this functionality?
Thanks in advance,
KathyJust in case you need the exact error. This:
$feedUrl = the_excerpt_rss(); // feed URL
$feedOut = getSomeFeed($feedUrl, 4, false, the_ID(), '', 36, false);
if ($feedOut)
says “2CGFR: RSS/XML url string was empty. Please check the arguments to parseURL..”
Also, my $feedUrl = line ends up printing the URL of the feed I’m trying to display.Yeah, give me a little bit here. It should work, IF feedURL is correct — my guess is something is encoded and screwing things up.
-dFirst, let me say this is a wonderful plug-in. Getting a working feed was practically impossible for me, but now thanks to Feedread it became easy.
I am wondering, however, if it would be possible to have different refresh rates for different feeds. One feed I am taking from a web forum needs frequent refresh to be up to date, but for news headlines I could (and so I should) ping at a slower rate.
What I first tried was setting the $XML_CACHE_TIME in the sidebar.php where I currently list the feeds. I just reset it for every feed. This didn’t work, but if I alter cg-feedread.php, the variable is set the same for all feeds.
Anyone know a good way around this?
- The topic ‘News Feeds’ is closed to new replies.