//first create file called callback.php
//in this file write
if(isset($_Get["hub_challenge"])){
echo $_Get["hub_challenge"];
return;
}
//which will be used to subscribe new rss feeds
//second recieve data
$my_array = json_decode(file_get_contents("php://input"));
//offcource you will not be able to see that data and to test it do one of the following to test test results
//1-mail it to your self
mail("youremail@yahoo.com","test callback",print_r($my_array,true));
//2-write it to file and make sure that file has 0777 permissions
file_put_contents("myfile.txt", print_r($my_array,true));
//third step if you want to manually add rss links by code not with superfeedr console.
//after inserting rss link to your db you have to send post request to superfeedr like this
function superfeedr_curl_post($url, array $post = NULL, array $options = array()){
$defaults = array(
CURLOPT_POST => 1,
CURLOPT_HEADER => 0,
CURLOPT_URL => $url,
CURLOPT_FRESH_CONNECT => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FORBID_REUSE => 1,
CURLOPT_TIMEOUT => 4,
CURLOPT_POSTFIELDS => http_build_query($post)
);
$ch = curl_init();
curl_setopt_array($ch, ($options + $defaults));
if( ! $result = curl_exec($ch)){
trigger_error(curl_error($ch));
}
curl_close($ch);
return $result;
}
function superfeedr_subscribe_rss($rss_url){
$mypost=array();
$mypost["hub.mode"]="subscribe";
$mypost["hub.verify"]="async";
$mypost["hub.callback"]="http://yoursite.com/yourcallback-file.php";
$mypost["hub.topic"]=$rss_url;
$mypost["superfeedr.digest"]=true;
$result=superfeedr_curl_post("http://myusername:mypass@superfeedr.com/hubbub",$mypost);
return $result;
}
//then simply you can call
superfeedr_subscribe_rss("http://www.aljazeerasport.net/Services/Rss/?PostingId=201191510242078998");