By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,191 Members | 2,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,191 IT Pros & Developers. It's quick & easy.

Simple data handler

P: n/a
I am doing some work developing a OneBox for a Google Mini. All I
need to do is take a $_GET values from the Mini (in this case,
specifically "query"), format it into a URI to pass off to another
script, get the results from that script in XML, and hand that XML
back off to the Mini. So basically it acts as a go-between, and
simple translator for the initial request.

So, the OneBox sends a request like:
http://www.website.com/isbn.php?query=0123456789

The script turns that into:
http://isbndb.com/api/books.xml?acce...ue1=0123456789

Then it gets the XML from that and just returns it to the OneBox as
is.

This is my first dive into some actual PHP development work, so I'm
having a slow time getting any real traction to start out, but I
figure if I can get this rolling, it won't be hard to flesh out.

Feb 8 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rik
psuwebmasters <ps***********@gmail.comwrote:
I am doing some work developing a OneBox for a Google Mini. All I
need to do is take a $_GET values from the Mini (in this case,
specifically "query"), format it into a URI to pass off to another
script, get the results from that script in XML, and hand that XML
back off to the Mini. So basically it acts as a go-between, and
simple translator for the initial request.

So, the OneBox sends a request like:
http://www.website.com/isbn.php?query=0123456789

The script turns that into:
http://isbndb.com/api/books.xml?acce...ue1=0123456789

Then it gets the XML from that and just returns it to the OneBox as
is.

This is my first dive into some actual PHP development work, so I'm
having a slow time getting any real traction to start out, but I
figure if I can get this rolling, it won't be hard to flesh out.

I did not see a question?

<?php
readfile('http://isbndb.com/api/books.xml?access_key=XXXXXXXX&index1=isbn&value1=' .$_GET['query']);
?>
--
Rik Wasmus
Feb 8 '07 #2

P: n/a
I guess I'm just wondering where to start at. I can get as far as
making the URI that needs to be queried, but then returning the
results is where I am a little stuck at. I was thinking something
like:

$isbn = $_GET["query"];
$key = "XXXXXXXX";
$link = "http://isbndb.com/api/books.xml?access_key=" . $key .
"&index1=isbn&value1=" . $isbn;
$xml = @simplexml_load_file($link) or die ("no file loaded") ;

I don't know if that'd be right or not, but I do know that if it is,
I'm not sure how to make sure that data gets returned to the OneBox.
The idea seems simple enough, but I fear I might be just a tad in over
my head.

On Feb 8, 9:41 am, Rik <luiheidsgoe...@hotmail.comwrote:
psuwebmasters <psuwebmast...@gmail.comwrote:
I am doing some work developing a OneBox for a Google Mini. All I
need to do is take a $_GET values from the Mini (in this case,
specifically "query"), format it into a URI to pass off to another
script, get the results from that script in XML, and hand that XML
back off to the Mini. So basically it acts as a go-between, and
simple translator for the initial request.
So, the OneBox sends a request like:
http://www.website.com/isbn.php?query=0123456789
The script turns that into:
http://isbndb.com/api/books.xml?acce...ex1=isbn&value...
Then it gets the XML from that and just returns it to the OneBox as
is.
This is my first dive into some actual PHP development work, so I'm
having a slow time getting any real traction to start out, but I
figure if I can get this rolling, it won't be hard to flesh out.

I did not see a question?

<?php
readfile('http://isbndb.com/api/books.xml?access_key=XXXXXXXX&index1=isbn&value...['query']);
?>
--
Rik Wasmus

Feb 8 '07 #3

P: n/a
On Feb 8, 10:03 am, "psuwebmasters" <psuwebmast...@gmail.comwrote:
I guess I'm just wondering where to start at. I can get as far as
making the URI that needs to be queried, but then returning the
results is where I am a little stuck at. I was thinking something
like:

$isbn = $_GET["query"];
$key = "XXXXXXXX";
$link = "http://isbndb.com/api/books.xml?access_key=" . $key .
"&index1=isbn&value1=" . $isbn;
$xml = @simplexml_load_file($link) or die ("no file loaded") ;

I don't know if that'd be right or not, but I do know that if it is,
I'm not sure how to make sure that data gets returned to the OneBox.
The idea seems simple enough, but I fear I might be just a tad in over
my head.

On Feb 8, 9:41 am, Rik <luiheidsgoe...@hotmail.comwrote:
psuwebmasters <psuwebmast...@gmail.comwrote:
I am doing some work developing a OneBox for a Google Mini. All I
need to do is take a $_GET values from the Mini (in this case,
specifically "query"), format it into a URI to pass off to another
script, get the results from that script in XML, and hand that XML
back off to the Mini. So basically it acts as a go-between, and
simple translator for the initial request.
So, the OneBox sends a request like:
>http://www.website.com/isbn.php?query=0123456789
The script turns that into:
>http://isbndb.com/api/books.xml?acce...ex1=isbn&value...
Then it gets the XML from that and just returns it to the OneBox as
is.
This is my first dive into some actual PHP development work, so I'm
having a slow time getting any real traction to start out, but I
figure if I can get this rolling, it won't be hard to flesh out.
I did not see a question?
<?php
readfile('http://isbndb.com/api/books.xml?access_key=XXXXXXXX&index1=isbn&value...['query']);
?>
--
Rik Wasmus
http://www.pastebin.ca/345566

That looks like it works. The server I was working on wasn't PHP5, it
was 4.4.4, which explained why it didn't show up with anything. That
code seems to check out well though. Thanks for the advice.

Feb 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.