Results 1 to 5 of 5
  1.    #1  
    ok guys, I need help. Please point me in the right direction. I've been waiting for access from a sight and I now find out that opening the DB for access was turned down. Someone made an app that does "almost" what my app does. All their app does is hit the web page and regergitate what the page says, but in a "pre" format. How can I hit a page in php and gather data from it to use in my app? Will ajax help? Please jst point me in he right direction.
  2. #2  
    It really depends on what you mean by "hit a page in PHP". Do you want to scrape it (pull data directly from the retuned HTML) or are you interfacing with an API that will return some sort of structured data (XML, JSON, etc)???

    Almost no sites give direct access to their DB anymore, most op for API access...
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  3.    #3  
    OK, here goes the explanation of what I want to query..

    they have on thier web site log in page:

    Code:
     <form method="post" action="/member.login.php" style="margin: 0px; padding: 0px">
    ...
    <td colspan="2" align="center"><select name="store" >
    ...
    <td><input type="text" name="card_number"  size="30" /></td>
    ...
    <td><input type="password" name="password" size="20"/></td>
    ...
    <td><a target="_blank" href="page.php?s=MOU" >M.O.U </td>
    <td><input type="checkbox" name="mou" value="true"/></td>
    All this for gathering the info and when you hit submit, it takes you to http://www.beerknurd.com/member.main.php

    Which then allows you to view beers through...

    Code:
    <a href="member.brews.php?sort=style">View Tasted Brews By Style</a><br />
    <a href="member.brews.php?sort=by_date">View Tasted Brews By Date</a><br />
    ...
    <a href="member.brews.php?sort=not_tasted">Brews You've Not Tasted</a>
    Once you click on "Brews You've Not Tasted" and view source you get...

    Code:
         <!--
         Array
    (
        [num_tasted] => 121
        [tasted] => Array
            (
                [174] => Array
                    (
                        [id] => 174
                        [brewer] => 9
                        [style] => 100
                        [country] => 1
                        [description] => Abita Purple haze is an American-style wheat lager with raspberry puree added post-filtration. The beer pours a deep golden color with a purple "haze" and sudsy white head with a delicately sweet raspberry nose. This beer is a quenching, semi-dry wheat lager with a tart touch of raspberry in the background.
                        [container] => draught
                        [name] => Abita Purple Haze
                        [city] => Abita Springs, LA
                        [style_name] => Fruit Wheat
                        [country_name] => United States
                        [brewer_name] => Abita Brewing Co.
                        [date_added] => 2009-11-29 00:20:29
                        [comments] => 
                        [rating] => 0
                    )
     
                [4028] => Array
                    (
                        [id] => 4028
                        [brewer] => 9
                        [style] => 14
                        [country] => 1
                        [description] => Golden in color with a light to medium body, this beer has a slight malt aroma and a medium dry flavor with a slight hop finish.
                        [container] => draught
                        [name] => Abita Restoration Ale
                        [city] => Abita Springs, LA
                        [style_name] => Pale Ale
                        [country_name] => United States
                        [brewer_name] => Abita Brewing Co.
                        [date_added] => 2010-02-18 01:51:17
                        [comments] => 
                        [rating] => 0
                    )
                   ...
           )
     
    )
    I am realy just trying to get to the tasted and not tasted lists so that I can input this information into my app and keep track of beers drank and not drank. I have my app working, for the most part, with hard coded beers and you have to manually adjust if a beer was drank or not.

    My bigest problem is that I have no clue where to begin. It looks like I can use AJAX to get info from the server. Anyone have some pointers or a site that would help explain what I need to do?
  4. #4  
    Getting your app to submit the form is easy (via AJAX). The problem (for me at least) would be finding a way to have the app auto-select the "Brews You've Not Tasted" link after the form is submitted and then parse the source code (which would happen inside the AJAX handler in the below example).

    To get you started, look at my AJAX example in this post: http://forums.precentral.net/web-os-...ml#post2231148
    Last edited by Laxidasical; 02/27/2010 at 05:18 PM.
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  5.    #5  
    Quote Originally Posted by Laxidasical View Post
    Getting your app to submit the form is easy (via AJAX). The problem (for me at least) would be finding a way to have the app auto-select the "Brews You've Not Tasted" link after the form is submitted and then parse the source code (which would happen inside the AJAX handler in the below example).

    To get you started, look at my AJAX example in this post: http://forums.precentral.net/web-os-...ml#post2231148
    Will have to take a closer look tonight, but this looks promising.

Posting Permissions