I'm just wondering if this module could function without the CURL extension. I am not a php developer but looked into the code and saw that it only fetches data via curl and could this be performed via fsockopen(). My hosting service provider doesn't support curl and they suggested to use fsockopen instead if possible. If someone could look at the code and tell me I could hire a developer and code it for me. Thanks.

CommentFileSizeAuthor
#1 amazontools_curl_removing.patch793 bytesbicou

Comments

bicou’s picture

StatusFileSize
new793 bytes

On my system (Ubuntu/2.6.20-16-generic, Apache/2.0 and PHP/5.2.1), I tried using fopen and drupal_http_request. The only difference between the two results were :
- different RequestId and RequestProcessingTime (of course)
- different user agent : ' Value="Drupal (+http://drupal.org/)"' is added right after 'Name="UserAgent"'
(Amazon's servers send us back the UserAgent we sent them, and as drupal sends its own user agent, it is different than the one used by php)

Hence, I think we should use drupal_http_request and remove cURL from the required software list (I don't have cURL installed on the server).

I attached a patch with my modifications, the module was 100% working and 100% not using cURL.

bomarmonk’s picture

Patch is for amazon.php4.inc, by the way. It didn't apply cleanly, but I made the change by hand and there are no more cURL related errors. However, my CCK content will not display the amazon data. Does a corresponding change need to be made to ASIN/ISBN module for CCK? Thanks for any suggestions as to what might be wrong.

wayland76’s picture

Status: Active » Needs work
wayland76’s picture

MGParisi’s picture

Status: Needs work » Closed (won't fix)

No longer supports 4.X! Sorry