Support » Plugin: Facebook Feed Grabber » [Plugin: Facebook Feed Grabber] Only feed videos

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author bonnerl


    It should be possible. I couldn’t tell you off the top of my head how to. You would have to get dirty by messing with some code. Which means every time I update the plugin at this point you’d have to update the new plugin file if you were to update.

    If you want to tackle it then have a look through Facebook’s Graph API. They also have an API Explorer where you can test API calls without messing with code.

    The portion of my code that calls Facebook is located in the facebook.php file; lines 476 through 489. More specifically the two lines containing '/'. $feed_id .'/feed?date_format=U'. The first one if you’re using caching; the second if you are not. If the only feed you’re displaying is with videos then you could simply change the before mentioned code. If you need to be able to go both ways then add a arguments array that you set to true when you want to limit it to videos.

    // Get the feed (maybe it's cached?)
    if ( $cache_feed != 0 ) {
    	// Include cache class
    	include_once 'caching.php';
    	// Initiate class
    	$cache = new ffg_cache();
    	// Let it do it's magic. (Will return the needed content)
    	$content = $cache->theMagic(&$this, '/'. $feed_id .'/feed?date_format=U', (($cache_feed * 60)));
    } else
    	$content = $this->facebook->api('/'. $feed_id .'/feed?date_format=U');

    Thank you for the fast answer. I will look into it.

    Plugin Author bonnerl


    No, problem. Just happened to check and see if anyone had posted anything related to my plugin.

    I had another thought for how to limit it to just videos. This option would retrieve the normal data then just skip anything not labeled as a video. The downside to this one is that if there aren’t any videos in the portion of the feed that it loads it won’t have anything to display.

    The actual code to add would be added to after the foreach starts on line 521 of the current facebook.php file.

    foreach($content['data'] as $item) {//this is currently on line 521
    	// You would add one of the following if statements.
    	// If you want to limit all feeds displayed
    	if ( $item['type'] != 'video' )
    	// If you only want to limit specific feeds by adding an a value to the args array with the key "video_only"
    	if ( $video_only == true && $item['type'] != 'video' )

    Every feed item has a type associated with it, I’m not sure what all is currently out there. I’ve got the plugin set up to not be based on the type.



    hmm, i wonder, wheter there is an easy way to filter the feed. i don’t want every little status, but only those, that contain a message (“<p class=’message’>”)?

    I agree with above. This plugin is awesomely simple but I’d like it to just display the news entered into facebook page rather than “….is now friends with”
    Example is

    Plugin Author bonnerl


    The next release will remove the “John Doe is now friends with Jane Doe” statuses. Hopefully later this week.

    Plugin Author bonnerl


    I just release 0.8.1 which filters these status out. Will be available when wordpress lets the update release.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Facebook Feed Grabber] Only feed videos’ is closed to new replies.