Adblock breaks this site

parsing data

Discussion in 'Web Programming' started by 0017513060, Oct 1, 2008.

  1. 0017513060

    0017513060 Forum Addict

    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0
    parsing data

    how would i go about parsing data off of a webpage with java script?

    if it isn't possible then just say so.

    or html if that can do it

    (like pictures and text)
     
  2. Merchant_in_the_dark

    Merchant_in_the_dark Grand Master
    Banned

    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0
    parsing data

    Please be more specific about what you're trying to do.
     
  3. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    parsing data

    There are only so many ways one can say "parsing data."

    I doubt you could do it without a more advanced language like PHP, which unlike JavaScript was made for preprocessing such things. HTML is a markup-language which your browser interprets to display content on a webpage, therefore it certainly can't do what you want, and JavaScript is made for the dynamic display of content (such as rollover menus and whatnot) on a webpage. I'm not sure about JavaScript, but I have an educated guess that you can't.
     
  4. Merchant_in_the_dark

    Merchant_in_the_dark Grand Master
    Banned

    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0
    parsing data

    ^^ I doubt that he's referring to the "parsing data" that we were thinking of.

    It seems like he's asking about pulling images and text out of web pages, but he's not being clear enough with his post.
     
  5. 0017513060

    0017513060 Forum Addict

    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0
    parsing data

    to be more specific, say i dont like that the rs DB is all cluttered and it loads slow. i want to parse only max/lowest price and the pic of the item.

    then put this data somewhere els (idc where really)
     
  6. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    parsing data

    So you want to grab the price on an item basicly and put it on your own site?
     
  7. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    parsing data

    Requires to be able to pull the entire webpage in to a string, and either split or use RegEx to gather the data. PHP is your best bet, but you need a server with support for PHP to do that.
     
  8. 0017513060

    0017513060 Forum Addict

    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0
    parsing data

    would apache on my computer work or do i NEED a server
     
  9. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    parsing data

    you just need to install php and it will work fine.
     
  10. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    parsing data

    If you want the site/script/page/whatever to be publicly released, then you need a server to host the PHP scripts on, yes.
     
  11. Merchant_in_the_dark

    Merchant_in_the_dark Grand Master
    Banned

    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0
    parsing data

    I'm actualy developing a program to do just this in ASP Classic/JScript.

    You have to learn the HTML ID system Jagex uses in their generation pages, and create a RegXP parser that pulls the info out that way.

    Once you have the ItemID, you can pull the images and graphs directly from the server.

    See my RS ItemID Viewer in the RS Cheating section for an example.
     
  12. PinBuyer_

    PinBuyer_ Active Member
    Banned

    Joined:
    Oct 10, 2008
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    3
    parsing data

    This can be done with cURL and SubString in PHP
     
  13. FartKnocker

    FartKnocker Forum Addict

    Joined:
    Sep 3, 2007
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    5
    parsing data

    So you would like to grab the max & lowest price & pic (hotlinking....) and put that on your own site?
     
  14. Supah Fly

    Supah Fly Active Member
    Banned

    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0
    parsing data

    a faster way would be file_get_contents(); and the use of my favorite function ss_between();

    PHP:
    function ss_between($string,$start,$end) {
       
    $string=" ".$string//The string.
       
    $startpos=strpos($string,$start); //Find the position of the start string.
       //Check if $startpos equals zero.
       
    if ($startpos == 0) {
          
    //If $startpos does equal zero, do this:
          
    return false//Return false.
       
    }
       else {
          
    //If $startpos doesn't equal zero, do this:
          
    $startpos+=strlen($start); //Add the string length of $start to $startpos.
          
    $endpos=strpos($string,$end,$startpos)-$startpos//Find the string position of $end.
          
    return substr($string,$startpos,$endpos); //Return the new value.
       
    }
    }
     
< starting new site! | Html Loser Here >


 
 
Adblock breaks this site