Fetch (mysql) ,extract(html), store(mysql)

Discussion in 'PHP' started by banan666, Mar 12, 2011.

  1. #1
    Got mysql table with 1000s of ULRs

    I want to loop through all the URL's (pages) and from each and every page extract a
    string that starts with XXX and ends with YYY on a line that starts with ZZZ

    Now I want to store the page url and the extracted string in a diffrent mysql table (same db).
    The string itself is an image URL so i want to fetch that image and store it on my ftp

    any help will be greatly appreciated
     
    banan666, Mar 12, 2011 IP
  2. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #2
    ssmm987, Mar 13, 2011 IP
  3. banan666

    banan666 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you! I'll try to piece it together ;)

    /a dba lost in phpspace
     
    banan666, Mar 13, 2011 IP
  4. banan666

    banan666 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Last step (got all the img-links into mysql)
    I also have a function, fetch_image("http://whatever.com/test.jpg") // it stores img on my ftp
    How do i pass the array fetched from mysql into the function?
     
    banan666, Mar 13, 2011 IP
  5. banan666

    banan666 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nevermind, got it to work as well.
    If anyone can point me in the right direction how to check if an image exist in a folder and if the size>0bytes and updated the DB with image_fetched=1 info I'll be a happy camper.
     
    banan666, Mar 13, 2011 IP
  6. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43