+ Reply to Thread
Results 1 to 4 of 4

 

Thread: Feed Insertion PHP script?

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Aug 2004
    Posts
    702
    Thanks
    5
    Thanked 0 Times in 0 Posts


    Hi guys

    I'm looking for a feed insertion php script that will allow me to grab selected feeds from AW or Buy.at and insert them into my database automatically.

    If anyone has a script they would be willing to share it would be much appreciated.

    Warmest wishes.

    Steven
    --
    Virtual Cards UK
    http://www.virtualcards.co.uk

  2. #2
    Dot Com Pennyaire

    Status
    Offline
    Join Date
    Jan 2004
    Location
    this month, Guatemala
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Steven,
    I find the easiest way is to use phpMyAdmin - insert text from file.

    You can manipulate one of the files in Excel (play around with the columns and record what you do in a macro) to make them match up.
    I used to have an open mind but my brains kept falling out.

  3. #3
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    obviously just the basics.... (all php)

    ## connect to your database stuff...

    $row = 1;
    $handle = fopen("$datafeed","r");
    while ($data = fgetcsv ($handle, 100000, ",")) {
    $row++;
    // opens the file specified by $datafeed and calls all the columns $data[...]

    $sql = "INSERT INTO tablename (all,your,stuff)
    VALUES ('$data[0]', '$data[1]', '$data[2]')";

    // where $data[0] is the first column, $data[1] is the second etc from the CSV file.

    $result = mysql_query($sql);

    }
    fclose ($handle);

    ## close database connection

    once you know which feed your using, you can do like str_replace on certain things to make it all tidy.

    For datafeeds that are zipped you can use gzopen instead of fopen

    lakrasia, this way saves you downloading the feeds, which can take a while. and it does all the matching up for you, which is always nice

    hope its of use
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  4. #4
    Dot Com Pennyaire

    Status
    Offline
    Join Date
    Jan 2004
    Location
    this month, Guatemala
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, thanks from me too, then. I tend to stick with anything that works, but I can see a few benefits from using a script instead.
    I used to have an open mind but my brains kept falling out.

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2