Results 1 to 10 of 10

Thread: automated data feed insertion

  1. #1
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783

    automated data feed insertion

    Hi guys,

    Am running, and am also planning, several sites that use a static data feed provided for affiliates.

    I'm currently doing the following manually:

    - download latest feed (in txt tab-delimited format) using wget
    - empty database via phpmyadmin (truncate)
    - insert new feed (using a simple php script to parse the txt file into SQL) into the database

    Can anyone suggest to me, or show me, how this could be done via cron?

    Thanks!
    Mark
    Stepping On Wires - the new blog

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    shouldn't be too hard (I have to do this myself soon).

    cron the wget

    make a php script for the database emptying

    cron both php scripts

    so it's be like

    wget whatever
    php location of php script
    php location of other php script
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    Thanks Chris!
    Stepping On Wires - the new blog

  4. #4
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Can you use wget to get things via FTP?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  5. #5
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    I'm sure I have before (to download server scripts/patches etc). If you need to login to the ftp server, you may need to use something like:

    wget ftp://youruser:yourpass@yoursite.com/file.gz

    (my syntax is probably messed up, though)
    Stepping On Wires - the new blog

  6. #6
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    On the other hand, try perhaps:

    wget --ftp-user=AFFILIATE_ID --ftp-passwd=AFFILIATE_PASSWORD https://www.domain.com/feed.gz

    - that may work...
    Stepping On Wires - the new blog

  7. #7
    Registered
    Join Date
    Jun 2004
    Posts
    16
    how about a nice tutorial on data feeds...

    regards
    garz

  8. #8
    Senior Member AndyH's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    553
    Know how to CRON PHP scripts?
    New website released. ya rly!

  9. #9
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    Do you have CPanel?
    Stepping On Wires - the new blog

  10. #10
    Senior Member AndyH's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    553
    If that is a question to me, mine was asking you. But I guess you do.
    New website released. ya rly!

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
  •