Beispiel #1
function fs_load_item_data($name, $days)
    // Calculate out the dates
    $minussev = mktime(0, 0, 0, date("m"), date("d") - $days, date("Y"));
    $end = date("Y-m-d");
    $start = date("Y-m-d", $minussev);
    // Get data from FeedBurner
    return fs_fetch_feedburner_data($name, "GetItemData", "dates=" . $start . "," . $end);
Beispiel #2
    function testFeedBurnerSuccess()
        // Create a Mock http object
        $fetcher =& new Mockhttp();
        $fetcher->setReturnReference('fetch', $fetcher);
        // Set the result of the Mock http object
        $fetcher->body = '<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
  <!--This information is part of the FeedBurner Awareness API. If you want to hide this information, you may do so via your FeedBurner Account.-->
  <feed id="jr03po9jr2s063gei3v9obmcl0" uri="Speedbreeze">
    <entry date="2009-06-20" circulation="19" hits="32" reach="1" />
        $fetcher->status = 200;
        // Set what we're expecting from the function
        $fetcher->expect('fetch', array(""));
        // Run the function
        $response = fs_fetch_feedburner_data("", "GetFeedData", "", $fetcher);
        // Assert what kind of response we want
Beispiel #3
    Copyright (c) 2008 - 2009 Jonathan Wilde

    This file is part of Feed Stats for WordPress.

    Feed Stats for WordPress is free software: you can redistribute 
    it and/or modify it under the terms of the GNU General Public License as 
    published by the Free Software Foundation, either version 2 of the License, 
    or (at your option) any later version.

    Feed Stats for WordPress is distributed in the hope that it will 
    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Feed Stats for WordPress.  If not, see 
// Figure out the URL for the information at FeedBurner
$feed = urldecode($_GET['feed']);
$response = fs_fetch_feedburner_data($feed, "GetFeedData", false);
$template = "[result][%+d] %s[result]";
// If there are no errors, tell the user that the feed is valid; if
// there are errors, print them out directly.
if ($response['success'] == true) {
    $status = fs_translatable_error("Valid");
    printf($template, $status['code'], $status['title']);
} else {
    printf($template, $response['error']['code'], $response['error']['title']);