Tag Archive for rss

Snipplr User and Tag RSS Feeds

<a rel="feed" href="http://snipplr.com/rss">Subscribe</a>

<a rel="feed" href="http://snipplr.com/rss/users/LeeRJohnson">Subscribe</a>

<a rel="feed" href="http://snipplr.com/rss/users/LeeRJohnson/language/sharp">Subscribe</a>

<a rel="feed" href="http://snipplr.com/rss/tags/c-sharp">Subscribe</a>

source

AutoRSS

<?php /* CLASS AUTORSS V 1.0 Autor : Roberto Aleman Email : ventics@gmail.com
This class is to automatic read and show  the files in a directory as rss 2.0 version,
only configure the config.php file with de globals vars and xml and rss versions,
the directory path and put config, callfile and autorss in directory to show at rss channel.
i apply to read a folder of images and show images gallery to rss channel with feedreader. Enjoy!!
GENERAL PUBLIC LICENCE , GPL */
class autorss
{
    public function show($document_type,$path,$xmlversion,$encoding,$rssversion,$atomversion,$title,$homelink,$description,$language,$lastupdate,$callfile,$generator,$permalink,$category)
    {
        header($document_type); // define document type header
        $dir=getcwd(); // get directory where is script
        $dr=@opendir($dir); //asign path to $dr var
        if(!$dr){
            echo "<error/>"; //if error, stop! and exit!
            exit;
        return;
        }
        else
        { //begin write xml file whith vars
echo "<?xml version='".$xmlversion."' encoding='".$encoding."'?>
<rss version='".$rssversion."' xmlns:atom='".$atomversion."'>
<channel>
<atom:link href='".$path."' rel='self' type='application/rss xml'/>
<title>".$title."</title>
<link>".$homelink."</link>
<description>".$description."</description>
<language>".$language."</language>
<lastBuildDate>".$lastupdate."</lastBuildDate>
<generator>".$generator."</generator>";
            while (($archivo = readdir($dr)) !== false)
        {
                if($archivo!="autorss.php" AND $archivo!="." AND $archivo!=".." AND $archivo!="error_log" AND $archivo!=$callfile )
                {
                clearstatcache() ;
                        $info = lstat($archivo);

echo "
<item>
<title>".$path.$archivo."</title>
<link>".$path.$archivo."</link>
<pubDate>".date('r' ,$info[9])."</pubDate>
<description><![CDATA[<img src=".$path.$archivo."></img><br/>File Size :".$info[7]." Bytes, Modified:".date('r',$info[9])."]]></description>
<guid isPermaLink='".$permalink."'>".$path.$archivo."</guid>
<category domain='".$path."'>".$category."</category>
</item>";
                }
        }
echo "</channel></rss>";
            closedir($dr);
            return;
        }
    }
}
?>

source

use jQuery & CSS to hide MYRSS & MYLINKS buttons in member profile edit pages

jQuery code to remove toolbar buttons:

<script type="text/javascript"  charset="utf-8">
$j(document).ready(function() {
$j("#ka_mkpMyRSS").remove();
$j("#ka_mkpMyLinks").remove();
});
</script>

Css code to hide the toolbar buttons:

#ka_manageSubNav.ka_mkpMyLinks, #ka_manageSubNav.ka_mkpMyRSS {display: none !important;}

source

Display WordPress Author RSS Feed on Author Pages Only

<?php if (is_author()) { ?><?php $author = get_userdata(get_query_var('author')); ?><link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> - <?php echo $author->display_name; ?>" href="<?php bloginfo('url'); ?>/author/<?php echo $author->user_nicename; ?>/feed/" /><?php echo "
"; } ?>

source

Magento RSS FEED

<?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
<a href="<?php echo $this->getRssLink() ?>" class="link-feed right"><?php echo $this->__('Subscribe to RSS Feed') ?></a>
<?php endif; ?>

source

Simple RSS2/Atom Reader

// feed reader
import com.adobe.xml.syndication.generic.FeedFactory;
import com.adobe.xml.syndication.generic.IFeed;
import com.adobe.xml.syndication.generic.IItem;

var blog:XML;
var blog_url:URLRequest = new URLRequest("http://visualadvance.com/blog/wp-rss.php");
var blogLoader:URLLoader = new URLLoader(blog_url);
blogLoader.addEventListener (Event.COMPLETE, blogLoaded);

function blogLoaded (e:Event):void
{
blog = XML(blogLoader.data);
trace (blog.channel.item[0].title);
}

source

Nice RSS Aggregator/Parser

<?php
$links = array('feed1', 'feed2', 'feed3');

foreach($links as $link){

$doc = new DOMDocument();
$doc->load($link);

$dataset = $doc->getElementsByTagName( "item" );
foreach( $dataset as $row )
{

$feeds = $row->getElementsByTagName( "link" );
$feed = $feeds->item(0)->nodeValue;

echo $feed.'<br />';
}
}
?>

source

How To Get Total Feedburner Subscribers With JQuery and ASP

<%
function GetFeedStats(rssFile)

Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.Async = False
objXML.SetProperty "ServerHTTPRequest", True
objXML.ResolveExternals = false
objXML.ValidateOnParse = false
objXML.preserveWhiteSpace = false
'objXML.Load("http://api.feedburner.com/awareness/1.0/GetFeedData?uri="&request.QueryString("url"))
objXML.Load("https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri="&request.QueryString("url"))

Set objRoot = objXML.documentElement

Set objItems = objRoot.getElementsByTagName("feed")
For Each objItem in objItems
temp = objItem.selectSingleNode("entry").getAttribute("circulation")
Next

Set objRoot = Nothing
Set objItems = Nothing

GetFeedStats = temp

end function
%>

<script type="text/javascript">
$(document).ready(function(){

$.get("feedburner.asp?url=ng-tech", function(data){
$("#feedburner").text(data);
});

});
</script>

<span id="feedburner"></span>

source

Parse RSS Feed

function SendAjax(url, callbackFunction) {
if (window.XMLHttpRequest) {
var request = new XMLHttpRequest();
} else {
var request = new ActiveXObject("Microsoft.XMLHTTP");
}

request.open("POST", url, true);
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText) {
ReceiveAjax(request.responseText, callbackFunction);
}
}
}

request.send(null);
}

function ReceiveAjax(response, callbackFunction) {
if (window.ActiveXObject) {
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.async = "false";
doc.loadXML(response);
} else {
var parser = new DOMParser();
var doc = parser.parseFromString(response,"text/xml");
}

callbackFunction(doc.documentElement);
}

function ValueFromTagName(item, tagname) {
var val = item.getElementsByTagName(tagname);
return val[0].firstChild.nodeValue;
}

function ParseData(data) {
var items = data.getElementsByTagName('item');
var output = '<ul>';

for (var i = 0; i < items.length; ++i) {
var title = ValueFromTagName(items[i], 'title');
var link = ValueFromTagName(items[i], 'link');

output += '<li><strong><a href ="' + link + '">' + title + '</strong> ' + '</li>';
}

output += '</ul>';

var RSSOutput = document.getElementById('RSSOutput');
RSSOutput.innerHTML = output;
}

function LoadFeed( url ) {
var GetFeed = url;
SendAjax('getfeed.php?url=' + escape(GetFeed.value), ParseData);
}
LoadFeed( "http://del.icio.us/rss/twelvetone" );

source

Capture RSS feed

<?php
if (!isset($_REQUEST["url"])) exit;

$url = $_REQUEST["url"];
if (substr($url, -0, 7) != "http://") exit;

echo file_get_contents($url);
?>

source