Adding XML-RPC integration
| Project: | Openads |
| Version: | 5.x-5.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I finally got around to upgrading my local Openads installation to the 2.3 series. As part of this I revisted this Drupal module and while it works fine with JavaScript, I wanted to see about using XML-RPC instead. I've got a working version of this module using XML-RPC and wanted to share the patch in case anyone is interested.
This requires the Openads openads-xmlrpc.inc.php file which is included in the Openads 2.3 installation. That file in turns requires the installation of the PEAR XML-RPC module. This file can in placed inside the openads module directory or in your PHP include path.
Possible future modifications to include the Openads local and remote (no javascript) invocation methods...
| Attachment | Size |
|---|---|
| openads.module.patch | 5.21 KB |

#1
Thanks! The patch worked perfectly. Ads are running much faster on the site using XML-RPC than they were using javascript. It would be great if this patch could be committed to the module.
#2
One downside of switching to XML-RPC is that if you have caching turned on, the ads will cache. I am not sure how to fix this. Any ideas?
#3
I have tried this patch on both versions 5.x-1.0 and 5.x-5.x-dev and keep getting the same errors:
patching file openads.module
Hunk #1 FAILED at 44.
Hunk #2 FAILED at 67.
Hunk #3 FAILED at 317.
Hunk #4 FAILED at 378.
Using Mac OS X terminal to patch, never had any problems before. Simple code: patch < patchname. Have placed xmlrpc-2.2 in the openads module folder. Am I using an incorrect version of the patch or module? Any suggestions?
#4
It seems that the files in the module tarball have DOS line endings which creates a problem with the patch. I don't have a Mac so I can't tell you what util to use to remove the DOS line endings on the module files but I know that for Linux one can use the dos2unix command to fix the files.
Once I ran dos2unix on the openads.module file I can patch with no problems.
#5
Regarding #2 yes there is the problem that cached users see the same ad. I have been working on
a solution for that and current testing seems ok.
Now if site caching is enabled and user is anonymous then openads module will use the
Javascript invocation method. Otherwise we can continue to use XML-RPC.
Stay tuned for an updated release for testing this out.
#6
#7
Automatically closed -- issue fixed for two weeks with no activity.