Help please

im try to make a script that will look at a web page like http://eve-kill.net/?a=kill_detail&kll_id=18884034 and get the ship details add any like items to get total of that item and compare it to a per defined list and say if it matches or not can anyone point me two a good starting point

Sounds like fun!

I haven’t written the entire script for you - that wouldn’t be any fun on your part 8)
Here is a good starting point for you.

[php]<?php
/**

  • Returns a table containing the ship details.
    **/
    function ship_details($url) {
    // get the page.
    $string = file_get_contents($url);
    // filter out the data we need…
    $start = strpos($string, ‘kl-detail-right’); // look for this…
    $r_arrow = strpos($string, ‘>’, $start); // move to the next right arrow.
    $l_arrow = strpos($string, ‘’, $r_arrow); // find the end of the table.
    $ship_details = trim(substr($string, ($r_arrow+1), ($l_arrow-$r_arrow)-1)); // get everything in between!
    return $ship_details; // return the info.
    } // end function.

// Ship Details.
$ship_details = ship_details(‘http://eve-kill.net/?a=kill_detail&kll_id=18884034’);
print $ship_details;
?>[/php]

Give it a whirl see how you go.
Red :wink:

that you for that it a big help now i just need help getting the right term for combining the like data i dont need the code would like to try and code on my own just need the right term all the search i have done keep coming up with merge join split so what is the term im looking for?

The script below works like so:

It grabs the entire page into a variable called string.
Then it searches the string for kl-detail-right - I knew to look for this by checking the source code and finding the part i needed.

Once i found kl-detail-right, i moved to the next > arrow (the closing tag)
I now have my starting point.
Next, I search for the next element as this will close the table we have grabbed.
I now have my end point.

The last line says, ‘starting here, and ending there, get me everything in between’ (IE the entire table)

You can grab more bits of data by checking the source code of the website and grabbing elements you require.

Hope that helps,
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service