Need a script for fetching data from website

Discussion in 'Scripts' started by rrathi99, Oct 3, 2010.

  1. #1
    Hi,

    m looking for a script which could either:

    print all the provided links in PDF or
    get predefined data from all the links provided.

    for example

    http://www.bseindia.com/bseplus/StockReach/AdvanceStockReach.aspx?scripcode=500390
    http://www.bseindia.com/bseplus/StockReach/AdvanceStockReach.aspx?scripcode=500325

    if I provide these links (in excel or txt) all the URLs are same except a query part, either the script print all the links in pdf OR give the required field from webpage in excel.

    thx
     
    rrathi99, Oct 3, 2010 IP
  2. coldcoder

    coldcoder Well-Known Member

    Messages:
    954
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #2
    I've made one like this, to fetch data from an website and insert it into database.
    you can search and read more about that functions

    file_get_contents // get page as source text file
    strstr // start searching inside this text (start point)
    strpos // end searching inside this text (end point)
    substr // to fit the results that you needs
    
    PHP:
    here are simple example

    $ORGtext1z= file_get_contents('http://win.softpedia.com/');
    $links1z=  strstr("$ORGtext1z",'<ul id="windows_cat">');
    $links2z = strpos("$links1z",'" title="');
    $inlinkz = substr($links1z,66,$links2z-66);
    echo "$inlinkz<br><br><br><hr>";
    PHP:
    that would brings to you the category from win.softpedia.com

    I wanna say it differ from website to website ... so you will need custom code to do this


    Note : i'm not sure fetching data from other websites is legal or not , i've made one fetch news (title,image,description) from an website and within 3 hours i got 22,000 articles lol but felt it is illegal
     
    coldcoder, Oct 4, 2010 IP
  3. AdimDen

    AdimDen Active Member

    Messages:
    123
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3

    Thanks for your help.
     
    AdimDen, Apr 10, 2012 IP