473,376 Members | 1,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,376 software developers and data experts.

PHP Nightmare.....Integration into ebaY listings

Hi guys,

I've been searching all day for a method on how to integrate the
listings off ebaY onto my website, but I have had no joy whatsoever.

I want to be able to open a listing based on the the item number,
which I can do simply by using,

$ITEMNUMER = ("blah");
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=$ITEMNUMER

but, I cannot use include(); to achieve what I want to do, because
a) it is having trouble including external webpages
b) the ebaY listing is generated upon arrival, so theres no way it
could interperate it.

I've been trying all kinds of fopen(); techniques, but nothing seems
to be able to open the page, because (I assume) it doesn't exist till
an actual browser visits it, and it calls it values from the ebaY
database.

So, I tied using the ebaY API, but I'll need to pay a hellish amount
to use it, so it seems out the question.

What I really want to do is have a script check a listing for some
text. But, as I cannot get PHP to open the file, I'm stuck !

If anyone knows a way how I can strip some information out of an
external web page using PHP - it would be gladly appriciated.
Jul 17 '05 #1
11 2306
le*****@gmail.com (ben lessani) wrote in
news:53**************************@posting.google.c om:
Hi guys,

I've been searching all day for a method on how to integrate the
listings off ebaY onto my website, but I have had no joy whatsoever.

I want to be able to open a listing based on the the item number,
which I can do simply by using,

$ITEMNUMER = ("blah");
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=$ITEMNUMER

[...]

What I really want to do is have a script check a listing for some
text. But, as I cannot get PHP to open the file, I'm stuck !


<?php

$data = file_get_contents("http://cgi.ebay.co.uk/ws/eBayISAPI.dll?
ViewItem&item=4356967161");

if(preg_match("/potty/i", $data, $match)){
echo "This eBay listing says '$match[0]'";
}

?>

(Don't ask me, I searched eBay for "PHP" and that came up...)

hth
--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
Jul 17 '05 #2
I tried that, and got...

Fatal error: Call to undefined function: file_get_contents() in
e:\phpdev\www\ebaytraders.com\test.php on line 12

Any more help ?
Thanks anyway, BTW
Senator Jay Billington Bulworth wrote:
le*****@gmail.com (ben lessani) wrote in
news:53**************************@posting.google.c om:
Hi guys,

I've been searching all day for a method on how to integrate the
listings off ebaY onto my website, but I have had no joy whatsoever.
I want to be able to open a listing based on the the item number,
which I can do simply by using,

$ITEMNUMER = ("blah");
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=$ITEMNUMER

[...]

What I really want to do is have a script check a listing for some
text. But, as I cannot get PHP to open the file, I'm stuck !


<?php

$data = file_get_contents("http://cgi.ebay.co.uk/ws/eBayISAPI.dll?
ViewItem&item=4356967161");

if(preg_match("/potty/i", $data, $match)){
echo "This eBay listing says '$match[0]'";
}

?>

(Don't ask me, I searched eBay for "PHP" and that came up...)

hth
--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources


Jul 17 '05 #3
le*****@gmail.com wrote in news:1108321417.931184.43170
@c13g2000cwb.googlegroups.com:
I tried that, and got...

Fatal error: Call to undefined function: file_get_contents() in
e:\phpdev\www\ebaytraders.com\test.php on line 12

Any more help ?


Which version of PHP are you using? If it's <4.3, this should work instead:

<?php

$data = join('', file("http://cgi.ebay.co.uk/ws/eBayISAPI.dll?
ViewItem&item=4356967161"));

if(preg_match("/potty/i", $data, $match)){
echo "This eBay listing contains '$match[0]'";
}

?>

hth
--
Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
Jul 17 '05 #4
I now have the following errors. I did a quick check, and I am running
PHP version...4.2.3

Warning: file("
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=4356967161") -
Invalid argument in e:\phpdev\www\ebaytraders.com\test.php on line 14

Warning: Bad arguments to join() in
e:\phpdev\www\ebaytraders.com\test.php on line 14

Jul 17 '05 #5
ben
Okay, I've been running all my scripts on my local machine using phpDev
- which is probably what is causing me all these errors. I just created
a file with the following code onto an online webserver of mine, and it
worked straight away.

<?php
// Get a file into an array. In this example we'll go through HTTP to
get
// the HTML source of a URL.
$lines =
file('http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=4356967161/');

// Loop through our array, show HTML source as HTML source; and line
numbers too.
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br
/>\n";
}

// Another example, let's get a web page into a string. See also
file_get_contents().
$html = implode('',
file('http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=4356967161/'));
?>
Looks like I've set up PHP poorly on my machine, or the Proxy I'm
forced to use is blocking the pages.

Thanks very much for your help !

Ben

Jul 17 '05 #6
le*****@gmail.com wrote in news:1108322269.247069.179110
@z14g2000cwz.googlegroups.com:
I now have the following errors. I did a quick check, and I am running
PHP version...4.2.3

Warning: file("
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=4356967161") -
Invalid argument in e:\phpdev\www\ebaytraders.com\test.php on line 14

Warning: Bad arguments to join() in
e:\phpdev\www\ebaytraders.com\test.php on line 14


OK, it looks like you may not have the URL fopen() wrappers enabled.
Check your php.ini file for this setting:

allow_url_fopen = 1

Make sure it's set to 1. If it already is, I'm not sure what to suggest;
I'm not very familiar with PHP running under Windows.

hth
--
Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
Jul 17 '05 #7
ben
It is turned on, but I suspect my proxy is causing it problems. I'll
try and stick to using my webhosting for this project.

I don't suppose you know of any webhosts that supply free MySQL and PHP
?

Ben

Jul 17 '05 #8
"ben" <le*****@gmail.com> wrote in news:1108323818.774983.143370
@z14g2000cwz.googlegroups.com:
It is turned on, but I suspect my proxy is causing it problems. I'll
try and stick to using my webhosting for this project.
Probably is something local, then - I just saw your other post re:
everything is working fine on your remote server.
I don't suppose you know of any webhosts that supply free MySQL and PHP
?


I'm not aware of any free hosts that support PHP/MySQL, but it's been
awhile since I looked into free hosts. I can suggest bluevirtual.com if
you're in the market for paid virtual hosting. No affiliation, just a
satisfied customer who followed the founders from their old employer,
where I'd been hosted since '98.

hth

--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
Jul 17 '05 #9
For a free host, you can always host yourself.

"Senator Jay Billington Bulworth" <f@fung.arg> wrote in message
news:Xn*************************@65.24.7.50...
"ben" <le*****@gmail.com> wrote in news:1108323818.774983.143370
@z14g2000cwz.googlegroups.com:
It is turned on, but I suspect my proxy is causing it problems. I'll
try and stick to using my webhosting for this project.


Probably is something local, then - I just saw your other post re:
everything is working fine on your remote server.
I don't suppose you know of any webhosts that supply free MySQL and PHP
?


I'm not aware of any free hosts that support PHP/MySQL, but it's been
awhile since I looked into free hosts. I can suggest bluevirtual.com if
you're in the market for paid virtual hosting. No affiliation, just a
satisfied customer who followed the founders from their old employer,
where I'd been hosted since '98.

hth

--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources

Jul 17 '05 #10
ben
I am hosting myself......and thats how I've run into problems :P

Jul 17 '05 #11
ben
I found a good cheap host in the end.

http://www.geodetech.com/

ben

Jul 17 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sam j | last post by:
Anyone know the best way to get page created in front page 2002 in an ebay listing. I've created a page but a lot of the format and graphics are missing when viewed in ebay Thanks Sam
37
by: asj | last post by:
awhile back, eBay decided to switch from a Microsoft/.NET/Windows architecture on the backend to a J2EE one, which might explain why their java backend will handle up to 1 BILLION page views a day!...
2
by: Bill | last post by:
I have looked up and down for a solution to this problem without any luck. I sell stuff on ebay. ebay will allow me to place javascript in my listings which I use to show a series of thumbnails of...
1
by: LP | last post by:
Hello, I am thinking about developing an application on my own free time (web or maybe even windows client) that watches eBay listings, places last seconds winning bids, etc. I am sure someone has...
4
by: VB Programmer | last post by:
Anyone know how to integrate an ASP.NET website with MLS (multiple listing service, used by realtors)? I want my site to display housing listings, etc... Thanks!
0
by: eBay-Mitglied gret | last post by:
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD> <TABLE cellSpacing=0 cellPadding=2...
4
by: Name Withheld | last post by:
OK i know this is a 101 question but... ASP.NET/VB.NET ListingItems() as string I need a nested array of Listings().ListingItems() so i can read a text file and split each line and insert...
7
by: samatair | last post by:
I need to change an existing listings page with pagination. Each page shows 10 listings and they are ordered by the date they are added to the site. Now recently added listings show up in the...
1
by: matz2k | last post by:
I've got a big problem with the CSS layout which I've produced with Photoshop/Dreamweaver especially for my ebay auctions. This is what it looks like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.