[HOW_TO] Generating gallery RSS feeds from text dumps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • just a punk
    So fuckin' bored
    • Jun 2003
    • 32385

    #1

    [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
  • acrylix
    Confirmed User
    • Oct 2006
    • 362

    #2
    Simply beautiful. I had not thought of this. Thank you for sharing.

    Comment

    • DVTimes
      xxx
      • Jun 2003
      • 31650

      #3
      bump for this great tip.
      XXX

      Comment

      • over38
        Confirmed User
        • Aug 2002
        • 460

        #4
        Wow awesome ! Any way to add a thumbnail or image?
        Mainstream Blazing Fast SSD WordPress Hosting
        As Low As $4.97/month! USA Based Support !

        Comment

        • shake
          frc
          • Jul 2003
          • 4663

          #5
          Thanks for the tip. I've got a little RSS work to do on one of my websites.
          Crazy fast VPS for $10 a month. Try with $20 free credit

          Comment

          • rhcp011235
            Confirmed User
            • Sep 2007
            • 538

            #6
            Bump for free code ;)
            Skype rhcp011235 | Cell Phone 212.812.9043 | Email [email protected]

            Comment

            • just a punk
              So fuckin' bored
              • Jun 2003
              • 32385

              #7
              Originally posted by over38
              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}

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

              Obey the Cowgod

              Comment

              • over38
                Confirmed User
                • Aug 2002
                • 460

                #8
                Thank you !
                Mainstream Blazing Fast SSD WordPress Hosting
                As Low As $4.97/month! USA Based Support !

                Comment

                • tonyparra
                  Confirmed User
                  • Jul 2008
                  • 4568

                  #9
                  what about adding flv or mp4?

                  High Performance Vps $10 Linode
                  Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                  Comment

                  • just a punk
                    So fuckin' bored
                    • Jun 2003
                    • 32385

                    #10
                    Originally posted by tonyparra
                    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.
                    Obey the Cowgod

                    Comment

                    Working...