Skip to content

BP External Activity

BP External Activity allows admins to import data from an arbitrary RSS feed into their BuddyPress sitewide activity stream. For example, you might use the plugin to add activity items for edits on a MediaWiki installation.

The plugin imports RSS feeds every hour. You may find that you need to decrease your Simplepie cache time to make it work:

add_filter( 'wp_feed_cache_transient_lifetime', create_function('$a', 'return 600;') );

reduces the RSS cache to ten minutes, for example. Put that in your bp-custom.php file if you are having problems with the plugin.

At the moment, the plugin uses the Author field from the RSS feed to look for a matching author in your WP database. If it doesn’t find one, it uses the unlinked text ‘A user’, as in ‘A user edited the wiki page…’.

Instructions

  1. Upload the bp-external-activity directory to your WP plugins folder and activate
  2. Open loader.php and replace the sample feed data with your own. Read the inline documentation carefully.

Future versions of the plugin will have a real admin interface (no PHP knowledge necessary), more sophisticated matching of feed authors with BP members, and the ability to attach feeds to groups.

Thanks to Andy Peatling, whose External Group Blogs served as the inspiration for a good part of the code.

Download the plugin here.

BP External Activity has been downloaded 974 times. Are you using this plugin? Consider a donation.

Version history

1.0 – May 25, 2010
Initial release

23 Responses to BP External Activity

  1. Joss Winn says:

    Thanks for this. You’re doing great work with BuddyPress and just wanted to let you know I appreciate it!

  2. Boone Gorges says:

    Thanks, Joss!

  3. Renee Pearson says:

    Will this also work with WP 3.0?

  4. I am trying to load the RSS feed to a twitter search. When I change the PHP file and activate the plugin the activity feed is populated with the tweets and everything looks good, but at the bottom of the page this is displayed:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘_bp_external_activity_refetch’ was given in /home1/rogersen/public_html/reformsymposium/wp-includes/plugin.php on line 395

    I am using WP 3.0, set up for multi-user with BP 1.2.5.2. I altered the loader.php file to read:

    $external_activity_feeds = array(
    array(
    ‘feed_url’ => ‘http://search.twitter.com/search.atom?q=%23rscon10′,
    ‘feed_action’ => ‘Tweeted’,
    ‘component’ => ‘Tweets’,
    ‘type’ => ‘tweet’,
    ‘show_text’ => __( ‘Show Tweets’, ‘bp-external-activity’ )
    ),
    );

    This would really enhance my site so I surely will donate. Thanks in advance.

  5. Boone Gorges says:

    Hi Christopher – Try commenting out lines 120 and 121 of bp-external-activity.php. That will almost certainly stop the error. (You should also comment out line 114 alert( “hi” ); – that was for testing and I meant to remove it, oops) The only trick is to make sure that the feeds are still refreshing regularly. Monitor your site over the course of a few hours after making these changes and see if it’s still working properly.

  6. Boone Gorges says:

    Renee – I don’t see any reason why the plugin wouldn’t work with WP 3.0. Give it a go.

  7. Aditya Mahesh says:

    Has the groups feature been created? Is there a way to manage the activity feed of certain groups using RSS?

  8. Porsche Heritage says:

    Hi,

    I was wondering if the variables are completely arbitrary?

    array(
    ‘feed_url’ => ‘http://news.search.yahoo.com/news/rss?p=Porsche&ei=UTF-8&fl=0&x=wrt’,
    ‘feed_action’ => ‘%s edited the wiki page %s’,
    ‘component’ => ‘wiki’,
    ‘type’ => ‘wiki_edit’,
    ‘show_text’ => __( ‘Show Wiki Edits’, ‘bp-external-activity’ )
    ),
    array(
    ‘feed_url’ => ‘http://api.bing.com/rss.aspx?Source=News&Market=en-US&Version=2.0&Query=porsche’,
    ‘feed_action’ => ‘%s posted the link %s on Delicious’,
    ‘component’ => ‘delicious’,
    ‘type’ => ‘new_delicious_link’,
    ‘show_text’ => __( ‘Show Delicious Links’, ‘bp-external-activity’ )
    ),

  9. Boone Gorges says:

    What do you mean by “completely arbitrary”? If you leave them as they are, then activity items will show up that say “A user edited the wiki page X”, where X is the item from the RSS feed.

  10. Porsche Heritage says:

    Ah, gotcha – gotcha! cool! Thank You soo much.. got it working! Im also trying to muck with it a bit so that it will pull news excerpt and post it. Thanks again!

  11. Ipstenu says:

    I’m having the same ish as Christoper.

    Lines 120 and 121 are

    });

    A blank line and then the close parens.

    I even went and pulled a fresh copy from http://plugins.svn.wordpress.org/bp-external-activity/trunk/bp-external-activity.php to make sure.

    Meanwhile lines 111 and 112 are commented out. I feel like I’m missing something here…

  12. stwc says:

    Hey boone — I’m back into Buddypress after going away for a while for a new project. Thanks for this plugin!

    I’m not using Groups on this project, but I see (or rather saw, when the error popped up and I looked at the code ;-) ) that there are dependencies on group stuff.

    Is that essential for some reason (if I understand, this is for the global activity stream, yeah), or can I strip it out in some clever way?

    Thanks!

  13. stwc says:

    I had a bash at it myself — rather than writing the last update time to groupmeta, I’m using

    update_site_option(bp_external_activity_lastupdate, gmdate( “Y-m-d H:i:s” ));

    and get_site_option to grab it.

    All seems well — I think all we’d need to do is just use the BP check for whether groups are enabled to generalize it (assuming the site_meta table is a good place to keep the timestamp)….

  14. Mark Hahnel says:

    Hey Boone,

    Im having the same problem as Ipstenu and Christopher, lines 120 and 121 do not seem the correct lines to edit out. Which lines should we be taking out to avoit the error message.

    Thanks,

    Mark

  15. stwc says:

    I’m pretty sure (but wait for Boone to confirm) that those of you with the _bp_external_activity_refetch problem just need to get rid of the leading underscore — I think it’s a typo!

  16. Mark Hahnel says:

    Thats done the job swtc. Thanks a lot.

  17. Ipstenu says:

    swtc’s fix gets that error done, but now I have an interesting error in my error_log..

    Call to undefined method WP_Error::get_item_quantity()

  18. stwc says:

    BTW Boone, I’ve now got the plugin working on my groups-disabled site. There’s an occasional bit of wonkiness, but if you’d like me to send you the code for you to laugh at and possibly use for a future, groups-optional version, just let me know.

  19. stwc says:

    (I would share it here, but I am still a seat-of-the-pants PHP coder, and wouldn’t want people to use it unreviewed in case it’s doing something terrible or dumb that I haven’t noticed yet).

    • Boone Gorges says:

      swtc – I’ve love to see what you’ve done. Can you drop me an email? boonebgorges at [gmail] .com

  20. stwc says:

    Sent!

  21. Charl says:

    Hi Boone.

    Has there been any head-way regarding the plugin. Ive had a look at YD BuddyPress Feed Syndication (http://wordpress.org/extend/plugins/yd-buddypress-feed-syndication/) and not enjoying working with the plugin though it does whats on the box. Dont want to work with a plugin containing encryted code.. removable but stil..

    I alse had a look at the External Blogs Plugin (http://bp-tricks.com/featured/allow-users-to-add-their-rss-feed-to-their-profile-with-the-external-blogs-plugin/) which seems to only import the 1st feed then stops working on the dev seems to have stopped.

    Let me know? and thanks for the hard work.

Pingbacks

  1. [...] Teleogistic I like to stop at the duty free shop Skip to content HomeAbout BooneDonateCodeWordPress/WordPress MUShared BlogrollImport from Ning: Import Ning users to WordPress and BuddyPressBuddyPressBP Include Non-Member CommentsCustom Profile Filters for BuddypressBP TinyMCEInvite AnyoneBP MPO Activity FilterEnhanced BuddyPress WidgetsBP Import Blog ActivityBP Group ManagementForum Attachments for BuddyPressGroup Forum Subscription for BuddyPressBP System ReportBuddyPress Group Email SubscriptionBP External Activity [...]

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>