Syndicating blog posts with Feed WordPress is a good tune, an old song here, from the heady days of early ds106 to my current class.

But what about aggregating comments from multiple blogs? It’s come up often over the years, and recently in the Twitters by fellow RSS junkies

What Martha built is rather useful, check out the dropdown menus for seeing comment counts.

And yes, Tom was right, I built a comment reader for the original Thought Vectors course (the URL is DOA, pointing to WPengine??) based on the knowledge that all WordPress and Blogger blogs provide an RSS feed for comments.

Yup this blog, yours (if WP or blogger) has a comment RSS feed. It’s predictable for WordPress- take the blog URL and tack on /comments/feed or http://cogdogblog.com/comments/feed/.

However, I’ve grown less sure that a separate comment aggregator site is the best way to go. It’s still wieldy to view, and keep track of what you read. Already an RSS reader is best for reading a lot of blogs; I have always down the same for my students blogs AND comment feeds.

In a glance I can see how active the comments are on the entire space, or one blog.

Scanning the comment activity on my netnarr student blogs.

This is done with some custom coding I put in all my syndication projects, this on the page where I list blogs within a sub category for my class among all the aggregated blogs

The Blog Comment OPML link dynamically downloads an OPML file that contains all subscriptions for blogs that have comment feeds (meaning WordPress and Blogger blogs). The URL can also be used in Inoreader for a dynamic subscription (loving Inoreader more on a daily basis).

I have done this for all my classes over the years teaching syndicated courses; it’s much easier for me to know what posts and comments activity are, and the web site, while pretty is not an efficient way to eyeball the activity.

How’s it done? Well, I harness long term wishes to wrap a lot of my Feed WordPress code into a plugin, but for now it’s still spun up by me. I recently set this up for the Ontario Extend syndication hub (I am also available for syndicated wedding and bar mitzvah sites) (bad joke).

As is two bits are needed in the themes functions.php — this is lazy, but I use a PHP constant to keep track of the default category ID

/* -----set syndicated blog category ID based on the category name */  
define( DEFCATID, get_cat_ID('The Network'));

And we also have to set up parameters can can pass in URLs

/* ----- add allowable url parameter for urls */


add_filter('query_vars', 'netnarr_parameter_queryvars' );

function netnarr_parameter_queryvars( $qvars )

// allow parameters to be passed in query string
{
	$qvars[] = 'group';
	$qvars[] = 'blogurl';
	return $qvars;
}     

Okay, then I create page template file in my theme (this is all in child theme, always make child themes for customizations) named page-comments-opml.php. In it goes all the functionality we need to generate OPML downloads:

term_id;
}

// keep a reference for the current category for an archive page
$mycat = get_category($catid);

// make the title complete
$pretty_title .= ' Comments for ' . $mycat->name;


//--------- set up db query
global 	$wpdb;

// custom query to get subscribed blogs from the links table with a feed/generator in the note

$custom_query =  
	"
	SELECT DISTINCT      
				wpl.link_name, wpl.link_url, wpl.link_rss, wpl.link_notes
	FROM        $wpdb->links wpl,  $wpdb->postmeta wpm
	WHERE       wpm.meta_key='syndication_feed_id' AND 
				wpm.meta_value = wpl.link_id AND 
				wpl.link_notes LIKE '%%{category#" . $catid . "}%%' AND 
				wpl.link_notes LIKE '%%feed/generator%%'
	ORDER BY    wpl.link_name ASC
	";

// run run run that query
$feedblogs = $wpdb->get_results( $custom_query );

// bail if we got nothing
if ( count( $feedblogs ) == 0 ) die ( "No blogs found for '"  . $mycat->name . "'" );

// headers to generate downloaded XML file
header ('Content-disposition: attachment; filename=' . sanitize_title( get_bloginfo( 'name' ) ) . '-comments-' . $mycat->slug . '.opml');
header ("Content-Type:text/xml"); 

// start output
echo '';
?>

    
        <?php echo $pretty_title ?>
    
    
        

link_notes , $matches);
	
	// got match; and remove trailing slash of we got one
	$base_url = rtrim( $matches[1], "/");
	
	// fish through the link notes for the feed generator
	$find_generator = preg_match ( '/feed\/generator: (.*)/' , $item->link_notes , $matches);
	
	// if we do have a designated feed generator, we are in business
	if ($find_generator) {
	
		// Build feed data for blogger feeds
		if ( strpos( $matches[1], 'Blogger' ) !== false ) {
			echo "\t\t" . '' . "\n";  
                
        } elseif ( strpos( $matches[1], 'wordpress' ) !== false ) {
        
        	// Build feed data for WordPress feeds
        	echo "\t\t" . '' . "\n"; 
        }
	
	}			
}      
?>	    
    

To put things in motion, create a blank WordPress Page named Comments OPML. By default it should use these template to do stuff.

Just calling it without parameters withh generate an OMPL for all blog comment feeds http://netnarr.arganee.world/comments-opml while passing a parameter like http://netnarr.arganee.world/comments-opml?group=kean-2018 generates OPML comment feed for my class while http://netnarr.arganee.world/comments-opml?group=open-2018 will fetch the comment feed from open participants.

Yes RSS readers are archaic, eh? But to me it is a more manage way to scan the comment activity than a punch of post-like things.

But more than that, I like to introduce my students to using feed readers. I did this last semester for my seminar students (with 4 students I just had them add the RSS directly to feedly) while at the same time encouraging them to build their own set of feeds.

Got comments on the idea of comment syndication? Yak below.


Featured Image: Conversation flickr photo by cogdogblog shared under a Creative Commons (BY) license

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

  1. Hi Alan,
    Looks like OPML is getting some well deserved love at the moment, so getting into a reader via opml would be excellent. FWIW inoreader lets you sub to an opml file on the web and adds subscriptions when they are added to the opml.

    The other thing I am thinking is worth a look at in this context is the indieweb and micro.blog. One of the things micro.blog does is send comments to your blog when someone replies on micro.blog, and replies to the reply. In this way micro.blog acts as an aggregator and place to converse. The conversations go back to the original post as webmentions. Of course this means you need to support webmentions on your blog with a plugin (that also lets you comment on someones blog by posting to your blog). I suspect that this is not ready for a class full of folk with differing abilities yet but it is quite fascinating.

    1. Yes, that subscription OPML in Inoreader is super handy for the way I do my OPML scripts as dynamic. In fact I got myself confused because I kept deleting subscriptions to my 2016 students blog comments in Inoreader, and they kept returning… until I remembered that is was dynamic link.

      That is an interesting approach for dealing with dispersed comments, I guess I should catch up to you in the micro.blog thing… my hunch is that it’s a bit more for new folks.

      I miss crossing paths with you!

      1. Hi Alan,
        Webmentions don’t really need micro.blog, supported by WordPress with plugins & themes. Sort of like modern pingbacks/trackbacks. Would be interesting in combo with an aggregated community (which micro.blog is but so is a FeedWordPress site), but need a bit of determination from bloggers at the moment.

        Our paths may not be crossing but through the wonders of RSS I am following yours;-)

  2. Hi Alan,
    I’ve been trying to work through this list:

    https://github.com/Kickball/awesome-selfhosted#feed-readers

    and evaluate which of these can be realistically self-hosted on a faculty/student DoOO. I have miniflux running on my domain, but it isn’t the solution I’m looking for mostly because of it’s newest version moving to the ‘go’ programming language, and also its lack of an option for a public view of aggregated sites and posts (everything is behind a private username and password). I hold on to my belief that there is a great tool out there that could eventually be worked into Installatron, but I’m still seeking.

    I agree 100% about modeling the practice of building feeds for learners. I’m starting to think personal aggregation is the answer for individuals, and course aggregation through Feed WordPress, WPeMatico, and other plugins is an answer for curation, or assessment, or discovery by the public. There are many great reasons to pull a community’s or a class’s posts into a hub WordPress site, but I think really building a practice of engagement is better done via a personal feed aggregator.

    Thanks for writing about RSS.

    1. Thanks Tim, your input means a lot.

      Still I am not 100% convinced of the need for reclaiming or having a hosted aggregator but do like the notion of people seeing it as a personal tool for their own use. The most important thing to have is your subscriptions as an OPML file. But then again, if it’s a reader that stores content, that’s a reason (thus Feed WordPress is more than a reader, it’s an archiver).

      At least there’s much to choose from!

Leave a Reply

Your email address will not be published. Required fields are marked *