parsing data

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

parsing data
  1. Unread #1 - Oct 1, 2008 at 4:30 PM
  2. 0017513060
    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0

    0017513060 Forum Addict

    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)
     
  3. Unread #2 - Oct 2, 2008 at 1:09 AM
  4. Merchant_in_the_dark
    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0

    Merchant_in_the_dark Grand Master
    Banned

    parsing data

    Please be more specific about what you're trying to do.
     
  5. Unread #3 - Oct 2, 2008 at 1:29 AM
  6. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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.
     
  7. Unread #4 - Oct 2, 2008 at 2:26 AM
  8. Merchant_in_the_dark
    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0

    Merchant_in_the_dark Grand Master
    Banned

    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.
     
  9. Unread #5 - Oct 2, 2008 at 6:39 AM
  10. 0017513060
    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0

    0017513060 Forum Addict

    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)
     
  11. Unread #6 - Oct 2, 2008 at 6:55 AM
  12. SuF
    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

    SuF Legend
    Pirate Retired Global Moderator

    parsing data

    So you want to grab the price on an item basicly and put it on your own site?
     
  13. Unread #7 - Oct 2, 2008 at 9:06 AM
  14. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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.
     
  15. Unread #8 - Oct 2, 2008 at 3:17 PM
  16. 0017513060
    Joined:
    Mar 9, 2007
    Posts:
    413
    Referrals:
    0
    Sythe Gold:
    0

    0017513060 Forum Addict

    parsing data

    would apache on my computer work or do i NEED a server
     
  17. Unread #9 - Oct 2, 2008 at 7:22 PM
  18. SuF
    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

    SuF Legend
    Pirate Retired Global Moderator

    parsing data

    you just need to install php and it will work fine.
     
  19. Unread #10 - Oct 2, 2008 at 8:32 PM
  20. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    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.
     
  21. Unread #11 - Oct 3, 2008 at 2:36 AM
  22. Merchant_in_the_dark
    Joined:
    Nov 27, 2007
    Posts:
    2,452
    Referrals:
    2
    Sythe Gold:
    0

    Merchant_in_the_dark Grand Master
    Banned

    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.
     
  23. Unread #12 - Oct 10, 2008 at 7:13 PM
  24. PinBuyer_
    Joined:
    Oct 10, 2008
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    3

    PinBuyer_ Active Member
    Banned

    parsing data

    This can be done with cURL and SubString in PHP
     
  25. Unread #13 - Oct 22, 2008 at 7:23 PM
  26. FartKnocker
    Joined:
    Sep 3, 2007
    Posts:
    285
    Referrals:
    0
    Sythe Gold:
    5

    FartKnocker Forum Addict

    parsing data

    So you would like to grab the max & lowest price & pic (hotlinking....) and put that on your own site?
     
  27. Unread #14 - Oct 24, 2008 at 12:38 PM
  28. Supah Fly
    Joined:
    Aug 22, 2007
    Posts:
    202
    Referrals:
    1
    Sythe Gold:
    0

    Supah Fly Active Member
    Banned

    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 >

Users viewing this thread
1 guest


 
 
Adblock breaks this site