GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   [HOW_TO] Generating gallery RSS feeds from text dumps (https://gfy.com/showthread.php?t=1069091)

just a punk 05-23-2012 09:40 AM

[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.

acrylix 05-23-2012 09:58 AM

Simply beautiful. I had not thought of this. Thank you for sharing. :thumbsup

DVTimes 05-23-2012 10:10 AM

bump for this great tip.

over38 05-23-2012 08:31 PM

Wow awesome ! Any way to add a thumbnail or image?

shake 05-23-2012 09:37 PM

Thanks for the tip. I've got a little RSS work to do on one of my websites.

rhcp011235 05-23-2012 09:48 PM

Bump for free code ;)

just a punk 05-24-2012 02:06 AM

Quote:

Originally Posted by over38 (Post 18962316)
Wow awesome ! Any way to add a thumbnail or image?

Sure thing. Here is the code:

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, $thumb, $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 "              <enclosure url=\"" . $thumb . "length=\"5\" type=\"image/jpeg\" />\n";
        echo "      </item>\n";
        $time -= 86400;
    }
    echo "</channel>\n";
    echo "</rss>\n";
}
?>

The appropriate dump format:

{title}|{description}|{thumb}|{url}

:warning BTW, if there are affiliate programs owners who want supply their affiliates with VALID XML and RSS feeds of their picture/video galleries and FLV/MP4 files (in TubeAce and SmartScripts formats for tubes) - don't hesitate to contact me.

P.S. I can even make these feeds morphing (titles, descriptions and images).

:pimp

over38 05-24-2012 06:13 AM

Thank you !

tonyparra 06-07-2012 04:30 PM

what about adding flv or mp4?

just a punk 06-07-2012 05:19 PM

Quote:

Originally Posted by tonyparra (Post 18992808)
what about adding flv or mp4?

That will be a bit more complicated code to meet the SmartScripts standards including parameters etc. I can do it as a custom job however. Don't hesitate to email me if you are interested.


All times are GMT -7. The time now is 09:58 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc