View Single Post
Old 05-23-2012, 09:40 AM  
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,350
[HOW_TO] Generating gallery RSS feeds from text dumps

As you maybe already know not all the affiliate allows to generate gallery RSS feeds which can be used by TGP scripts or autoblogging plugins like CyberSEO.

Let me show you an easy way on how to generate the gallery RSS feeds of the usual text dumps. So, here we go.

1) Save the following code as xml.php and upload it to your host (e.g. yoursite.com/xml.php)

Code:
<?php
if (isset ( $_GET ["dump"] )) {
    $dump = file ( $_GET ["dump"] );
    $time = time ();
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    echo "<rss version=\"2.0\">\n";
    echo "<channel>\n";
    echo "<title>My Feed</title>\n";
    foreach ( $dump as $item ) {
        list ( $title, $desc, $url ) = explode ( "|", trim ( $item ) );
        echo "       <item>\n";
        echo "               <title>" . $title . "</title>\n";
        echo "               <link>" . $url . "</link>\n";
        echo "               <guid>" . $url . "</guid>\n";
        echo "               <pubDate>" . date ( "D, d M  Y H:i:s O", $time ) . "</pubDate>\n";
        echo "               <description><![CDATA[" . $desc . "]]></description>\n";
        echo "       </item>\n";
        $time -= 86400;
    }
    echo "</channel>\n";
    echo "</rss>\n";
}
?>
2) Generate a text dump of your picture galleries in to following format (fortunately NATS4 still allows that):

{title}|{description}|{url}

Make sure all your galleries have titles and descriptions, then save the dump as a text file and also upload it to your host (e.g.: yoursite.com/site1_dump.txt).

3) Now open this link in your browser: yoursite.com/xml.php?dump=site1_dump.txt

The STANDARD TGP RSS feed will be generated. You can import it to your blog using standard code without any magic tricks from my side.

The mentioned above simple 3-step manual will work with any sponsor which allow to generate text dumps, thus it's absolutely universal.
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote