Jump to content

Recommended Posts

I am not a very good php programmer yet..  More of an editor to make stuff look like I want.  So I have a question to see if I could get some coding ideas and to see if what I want to do is possible.

 

I have a stock quote feed that I can pull back live stock info via a java applet.  It is all fine, but if I could pull a few symbols independently of the applet, I would like to place them info a custom graphic, like for index numbers and such.

 

The way the script works, is by typing in:

localhost/stockquote/stockquote.php?symbols=goog,msft,ibm

 

it will return the current info.  If you pull it with that url into a browser it will look like this:

SYMBOL:GOOG LAST TIME:N/A LAST:465.24 CHANGE:4.83 CHANGEP:1.05% TREND:+ TIME:10:14:05 SYMBOL:MSFT LAST TIME:N/A LAST:24.41 CHANGE:0.74 CHANGEP:3.13% TREND:+ TIME:10:14:05 SYMBOL:IBM LAST TIME:N/A LAST:119.9 CHANGE:0.95 CHANGEP:0.80% TREND:+ TIME:10:14:05

 

If you look at the source code of that it looks like this:

<body>SYMBOL:GOOG

LAST TIME:N/A

LAST:465.24

CHANGE:4.83

CHANGEP:1.05%

TREND:+

TIME:10:14:05

SYMBOL:MSFT

LAST TIME:N/A

LAST:24.41

CHANGE:0.74

CHANGEP:3.13%

TREND:+

TIME:10:14:05

SYMBOL:IBM

LAST TIME:N/A

LAST:119.9

CHANGE:0.95

CHANGEP:0.80%

TREND:+

TIME:10:14:05

</body>

 

Would it be possible make this request via php, parse it into variables and then be able to assign those variables to be displayed on a web page.  And if that is possible, would it also be possible to have the code executed ever 10 sec or so to make the updates automatic instead of having to refresh to update.

 

I hope I have posted this in the right forum and thanks for any help in advance...

Link to comment
https://forums.phpfreaks.com/topic/171427-parsing-question/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.