Sunday, July 1. 2007
Comments
Display comments as
(Linear | Threaded)
Hi,
I agree with your opinion that Compete guys better put links to this kind of developers' resources from their api page.
I am proposing PHP5 wrapper for Compete API on pear.
At this point that wrapper is very preliminary so any feedback are appreciated.
I agree with your opinion that Compete guys better put links to this kind of developers' resources from their api page.
I am proposing PHP5 wrapper for Compete API on pear.
At this point that wrapper is very preliminary so any feedback are appreciated.
Hi Jonathan,
Deal!!
Thanks for checking out the API. I agree with all of your comments.
I've made most of the additions/changes you suggested. We plan to add a "Developers" link to the homepage soon as well.
In case you're interested, here is a link to a .NET wrapper:
http://www.codeplex.com/CompeteNET
Deal!!
Thanks for checking out the API. I agree with all of your comments.
I've made most of the additions/changes you suggested. We plan to add a "Developers" link to the homepage soon as well.
In case you're interested, here is a link to a .NET wrapper:
http://www.codeplex.com/CompeteNET
akky, typical, someone has gotten there before me. I did a quick google search but didn't find anything promising so wrote my own from scratch.
With regards your package is there a reason you use simplexml_load_string rather than simplexml_load_file? Seems like you're giving yourself a lot of extra work and I can't see the benefit.
Jay, It's looking better already. I put together a class last night so all is looking good on my end. I'll give it a quick look just to make sure no bugs kept in and then put it up on the site.
With regards your package is there a reason you use simplexml_load_string rather than simplexml_load_file? Seems like you're giving yourself a lot of extra work and I can't see the benefit.
Jay, It's looking better already. I put together a class last night so all is looking good on my end. I'll give it a quick look just to make sure no bugs kept in and then put it up on the site.
Jonathan,
The reason I avoided simplexml_load_file() is mainly error-handling.
With simplexml_load_file() you cannot tell whether it was a network error or a xml-parse error except calling libxml*() function, and if you do that error-check-dispatching anyway, it is easier to call them in two different phases and sees each results. I also did not want 'allow_url_fopen' option check for library users environment.
Other reasons are to save possiblities for case when you will need to enhance functionarities in future. Such like Compete API will introduce different authorization scheme (ssl, basic auth, etc.), someone wants to insert well-formed check or other kind of filtering for him/her, and so on. Making networking layer separated may gain some flexibility I reckon. Of course, I cannot say what will be needed later at this point so this is also merely my preference.
If you do not dislike PEAR, you are always welcome to join the package. PEAR is still a popular library repository where many people try to find libraries for PHP.
The reason I avoided simplexml_load_file() is mainly error-handling.
With simplexml_load_file() you cannot tell whether it was a network error or a xml-parse error except calling libxml*() function, and if you do that error-check-dispatching anyway, it is easier to call them in two different phases and sees each results. I also did not want 'allow_url_fopen' option check for library users environment.
Other reasons are to save possiblities for case when you will need to enhance functionarities in future. Such like Compete API will introduce different authorization scheme (ssl, basic auth, etc.), someone wants to insert well-formed check or other kind of filtering for him/her, and so on. Making networking layer separated may gain some flexibility I reckon. Of course, I cannot say what will be needed later at this point so this is also merely my preference.
If you do not dislike PEAR, you are always welcome to join the package. PEAR is still a popular library repository where many people try to find libraries for PHP.
Hi Akky
The improved error handling bears out my brief appraisal of the PEAR package.
I'm quite a fan of PEAR though I haven't submitted any code as yet. As I mention in the follow-up - http://torrentialwebdev.com/blog/archives/107-PHP5-Compete-API-Wrapper.html - a hybrid of our two packages could well be the superior option. Your package is stronger on error checking while my package gives better access to the data. If you would be willing to work together I think that would be great. I think there is potential for a better finished project when compared to what either of us have so far.
p.s. Is the email address you submitted your real address? If so presumably it has been created on the fly. How do you get gmail to do that? Or is it an anti-spam method with the expectation that I cut out the torrentialwebdev bit?
The improved error handling bears out my brief appraisal of the PEAR package.
I'm quite a fan of PEAR though I haven't submitted any code as yet. As I mention in the follow-up - http://torrentialwebdev.com/blog/archives/107-PHP5-Compete-API-Wrapper.html - a hybrid of our two packages could well be the superior option. Your package is stronger on error checking while my package gives better access to the data. If you would be willing to work together I think that would be great. I think there is potential for a better finished project when compared to what either of us have so far.
p.s. Is the email address you submitted your real address? If so presumably it has been created on the fly. How do you get gmail to do that? Or is it an anti-spam method with the expectation that I cut out the torrentialwebdev bit?
pear-dev mailing list has a thread around my proposed Compete package and its feedbacks.
http://marc.info/?l=pear-dev&w=2&r=1&s=Services_Compete&q=b
It is pointed out that having different data for returning values is better, so value-fetch interface like yours may be the answer for it.
And yes, my email address is for tracing, gmail allows you to use '+(tracename)' and many '.'s, though that is not a perfect solution against page-scraping spammers. You may either remove after '+' or just use the mail address includes '+'.
http://marc.info/?l=pear-dev&w=2&r=1&s=Services_Compete&q=b
It is pointed out that having different data for returning values is better, so value-fetch interface like yours may be the answer for it.
And yes, my email address is for tracing, gmail allows you to use '+(tracename)' and many '.'s, though that is not a perfect solution against page-scraping spammers. You may either remove after '+' or just use the mail address includes '+'.
Interesting stuff from gmail there. I'll contact you by email and we can sort something out.

My post from last night discussing the Compete API received two comments. The first highlighted that there was already a proposal in PEAR. Great to hear but as I did much of the work for a wrapper last night you'll get another version now. Actually the
Tracked: Jul 02, 08:10
A couple of quick announcements . . . New PEAR package for the Compete API After writing about the compete API Hiroki Akimoto contacted me mentioning a proposal he had made to PEAR. Our scripts each had strengths and we decided to combine our atte
Tracked: Aug 02, 14:16