Results 1 to 5 of 5
  1. #1
    Newbie
    Join Date
    May 8th, 2010
    Posts
    8
    Are Link Subscription Filenames COMPLETELY random?
    Link_Subscriptions_XXX_YYY_1282034757483.txt

    WHAT The hell is that giant random string (the last part before .txt) in the filename? Am I supposed to be expecting just a completely different filename each day, with no way to predict it? On 6/24 they added this worthless junk.

  2. #2
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Looks like they changed the file name format on 4/29 and then again on 6/29. I must be coded to grab the newest file regardless of the file name because they are still being imported into my database.

    You may have to contact their support if you can't make it work, as they rarely post here any more except for new program announcements.


  3. #3
    Full Member gcarson's Avatar
    Join Date
    November 13th, 2009
    Posts
    383
    I feel your pain.

    John. Can you give any hints on how to grab the last file? It looks like its standard up to the date, then there are random 13 characters. I was a math major and do know how to do some code analysis but I don't think NASA scientists can break that 13 number code. I image you can look for a file that starts with a certain say 10 characters and ignore the rest of the file name, just not sure what that php function might be?

    Or, I guess what you could do. Keep new files in 1 folder. After they are processed, moved those to the processed folder. Then, hopefully, there should only be 1 file in the 'unprocessed' folder. But that's assuming GAN only sends 1 file a day...
    Last edited by gcarson; August 20th, 2010 at 11:10 AM.

  4. #4
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    I create this function:
    PHP Code:
    // To pick the newest feed of Orange links from Performics
    function get_newest_file($path)
    {
        
    date_default_timezone_set('America/Chicago');
        
    // store all .txt names in array changed 3/13/2009
        
    $p opendir($path);
        while (
    false !== ($file readdir($p)))
        {
            if (
    strstr($file".txt"))
                
    $list[] = $path $file;
        }
        
    // sort array descending
        
    rsort($list);
        
    // return newest file name
        
    return $list[0];

    I call it at the beginning of my script with this:
    PHP Code:
    $path BASE_URI 'perforange/';

    // Get the newest OrangeLinks file only
    $single_file get_newest_file($path);
    $feed fopen($single_file'r'); 
    Remember they used to be called Orange Links and I have GAN ftp them to a directory in my root. BASE_URI reflects that. The files from GAN pile up and I manually delete them every month or so.


  5. #5
    Full Member gcarson's Avatar
    Join Date
    November 13th, 2009
    Posts
    383
    Awesome. That's why I love coding. So many ways to accomplish the same goal. Never thought of it that way but I can see how it works. Thanks for the share as I'm sure it will help a lot of people out!

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Still Waiting for my Link Subscription File
    By Uncle Rico in forum Google Affiliate Network - GAN
    Replies: 4
    Last Post: November 19th, 2009, 08:02 PM
  2. Link Subscription File All Messed Up This Morning
    By Uncle Rico in forum Google Affiliate Network - GAN
    Replies: 4
    Last Post: April 30th, 2009, 10:41 AM
  3. Filenames with non alpha-numeric characters
    By Nature Boy in forum WebMerge (Fourthworld.com)
    Replies: 4
    Last Post: June 2nd, 2004, 09:58 PM
  4. Random link program
    By freetweak in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: October 20th, 2001, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •