Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
168113a
Add basic support for XMLRPC invocation of OpenX ads
Sep 30, 2009
5283812
Add basic support for XMLRPC invocation of OpenX ads (version bump)
Sep 30, 2009
4ed547c
Update readme information with configuration and copyright info
Sep 30, 2009
22b5ebf
Change to using internal XMLRPC Client that has some simple retry/rec…
dansketcher Sep 30, 2009
807c383
Move (commented-out) debug lines to new class
dansketcher Sep 30, 2009
b5cff44
Add support for accessing keywords on OpenX banners (where server is …
dansketcher Oct 5, 2009
496cb64
Add explicit support for retrying in the face of 'Session ID is inval…
Oct 23, 2009
b9e7e2e
Version bump to 0.0.0
dansketcher Oct 26, 2009
cab34a5
Version bump to 1.0.0
dansketcher Oct 26, 2009
a5ba5f8
Version bump to 1.1.0
dansketcher Oct 26, 2009
9d35362
Remove inadvertent dependence on ActiveSupport
dansketcher Oct 26, 2009
6264eff
Package and deploy gem to gemcutter.org
dansketcher Oct 26, 2009
0d8a980
Readme for deployed gem
dansketcher Oct 26, 2009
169909f
Enviroment variable handling for non-*nix and non-standard environments
dansketcher Nov 6, 2009
02ef5f7
Version bump to 1.1.1
dansketcher Nov 6, 2009
8c27456
Update gemspec
dansketcher Nov 6, 2009
d5b31cd
Correct formatting of README
dansketcher Nov 19, 2009
7b860ea
Documentation update
dansketcher Nov 19, 2009
4f17005
Documentation update
dansketcher Nov 19, 2009
517225b
Documentation update
dansketcher Nov 19, 2009
66876ed
Documentation update
dansketcher Nov 19, 2009
95c3acb
Add documentation and patch for enabling Banner Keyword access via API
dansketcher Nov 19, 2009
a88468a
Add documentation and patch for enabling Banner Keyword access via API
dansketcher Nov 19, 2009
2445927
Update History
dansketcher Nov 19, 2009
869c0b3
Update gemspec to include new readme and patch files
dansketcher Nov 19, 2009
bb46410
Version bump to 1.1.2
dansketcher Nov 19, 2009
e7a38f8
Update gemspec for new version
dansketcher Nov 19, 2009
3f4a6d1
Update history for new version
dansketcher Nov 19, 2009
fe38455
Update copyright notice
dansketcher Nov 24, 2009
c459b80
Added methods publisher_statistics and zone_statistics. Changed stat…
Apr 18, 2010
804e2d7
changed touchlocal-openx.gemspec into jjp-openx.gemspec
Apr 18, 2010
72e0ed7
added jjp-openx.gemspec
Apr 18, 2010
6b437ce
Some doc changed, settings to push gem in version 1.1.4 to RubyGems.org
Apr 18, 2010
37e9d6a
v 1.1.5 - localTZ for v2 of OpenX API added with respect of v1 not us…
May 19, 2010
570a6b5
v 1.1.6
May 19, 2010
b3d9c07
config.gem changed to jjp-openx
Feb 6, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.swp
.svn/
pkg/
61 changes: 61 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,64 @@

* Birthday!

=== 1.1.0 / 2009-10-26

* 2 major enhancements

* OpenX API Version 2 Support added
* OpenX Invocation API Support added

* 1 minor enhancement

* Ruby on Rails documentation support added

=== 1.1.1 / 2009-11-06

* Minor bugfix to environment handling for Win32 users

=== 1.1.2 / 2009-11-19

* Documentation updates and patch to enable banner support on the OpenX Server

=== 1.1.4 / 2010-04-17

* Fork of 1.1.2

* Added statistic methods for Banner:

* renamed statistics method into daily_statistics, left statistics method as an alias for daily_statistics
* daily_statistics(start_on = Date.today, end_on = Date.today) - Daily stats for the Banner
* publisher_statistics(start_on = Date.today, end_on = Date.today) - Banner stats by Publisher
* zone_statistics(start_on = Date.today, end_on = Date.today) - Banner stats by Zone

=== 1.1.5 / 2010-05-18

* Created generic statistics method:

* get_statistics(service_method, start_on = Date.today, end_on = Date.today, local_time_zone = true) in sepearate module OpenX::Services::Statistics in file statistics.rb
* included statistics module in all stats objects: Agency, Advertiser, Campaign, Banner, Publisher, Zone.
* all existing statistics methods are now calling get_statistics.

* Added to statistics methods localTZ parameter default to true. This way OpenX will return stats for the period of time with offset according to the local time zone. If that parameter is false it will give numbers for UTC. The localTZ implementation based only on that post http://forum.openx.org/index.php?s=18f1d84f86e32297083f87f8d9eb4fda&showtopic=503433151

* statistics
* daily_statistics
* publisher_statistics
* zone_statistics

* Added statistics methods for other objects as well

* Agency
* Advertiser
* Campaign
* Banner
* Publisher

* daily_statistics
* banner_statistics

* Zone

=== 1.1.6 / 2010-05-18

* lib/openx/services/statistic.rb file was missing on github while building gemspec, so the version 1.1.5 is actually broken.
139 changes: 139 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
= OpenX

* http://rubygems.org/gems/jjp-openx
* http://github.com/DoppioJP/openx

== Description

A Ruby interface to the OpenX XML-RPC API. Used touchlocal 1.1.2 version as base for adding more API calls to OpenX API from http://developer.openx.org/api/ . It also works with v2 of OpenX API, especially that it now can pass localTZ to the OpenX API which will give back the correct statistics for the local time zone.

== Synopsis

OpenX::Services::Base.configuration = {
'username' => 'admin',
'password' => 'password',
'url' => 'http://localhost/www/api/v2/xmlrpc/',
}

OpenX::Services::Agency.find(:all).each do |agency|
puts agency.name

# Look up publishers
agency.publishers.each do |publisher|
puts "-- #{publisher.name}"
end

# Create a publisher
Publisher.create!(
:agency => agency,
:name => 'My Test Publisher',
:contact_name => 'My Contact',
:email => 'agency@example.com',
:username => 'user',
:password => 'password'
)
end

== Requirements

* ruby

== Install

* sudo gem install touchlocal-openx --source "http://gemcutter.org"
* add "require 'openx'" to your code
* Update your $HOME/.openx/credentials.yml file. Here is a sample:

production:
username: admin
password: admin
url: http://www.example.com/www/api/v2/xmlrpc/
invocation_url: http://www.example.com/www/delivery/axmlrpc.php

The YAML file lists configuration for each environment. The gem uses the
'production' environment by default. Trailing slash is required on the 'url'.
'invocation_url' is only used by the OpenX::Invocation methods to serve
advertisements over XML-RPC

== Ruby on Rails Integration

As common deployment scenarios for RoR projects dictates that you manage all
of your dependent files from within your project, storing your credentials.yml
file in the default location (as above) will not work. However, this is easily
fixed.

Create your credentials.yml file in your ./config folder, and populate it with
the necessary environment settings. It may in fact be more useful to name your
file something like openx_credentials.yml to be explicit about the content.

Then, add your gem require line to the initialize block of the environment.rb:

config.gem "jjp-openx",
:lib => "openx", :source => "http://gemcutter.org"

You will of course need to install the gem, either manually or via
rake gems:install

Finally, create a config/initializers/openx.rb and include the following:

require 'yaml'
OpenX::Services::Base.configuration =
YAML.load_file(File.join(Rails.root, 'config', 'credentials.yml'))[Rails.env]


== Banner Keyword Support

Not all attributes of OpenX objects that can be set in the web interface are
accessible via the API. A notable case of this is the ability to access
Banner Keywords. While it seems to be a case of "We'll add them as people
need them," this process is slower than one might expect;
https://developer.openx.org/jira/browse/OX-4779 has been an open ticket since
January 2009.

As TouchLocal required the ability to access Banner Keywords, the
OpenX::Services::Banner object has the support for this attribute. If the
server does not support the attribute, then setting it will have no effect,
and it will return nil when retrieving it. To enable support on the server,
you will need access to the server source, and the included
php/openx-2.8.1-keywords.diff

Copy the openx-2.8.1-keywords.diff file to the root of the OpenX distribution
on your server, and execute:

patch -p0 < openx-2.8.1-keywords.diff

This will patch the relevant OpenX API to allow access to the keyword
attribute, meaning that now both your client and server support it. Happy days.

This patch has been tested on OpenX Server versions 2.8.1 and 2.8.2 at the
time of writing.


== License

(The MIT License)

Copyright (c) 2008:

* {Aaron Patterson}[http://tenderlovemaking.com]
* Andy Smith
* {TouchLocal Ltd}[http://www.touchlocal.com]

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
80 changes: 0 additions & 80 deletions README.txt

This file was deleted.

32 changes: 16 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# -*- ruby -*-

require 'rubygems'
require 'hoe'
require 'rake'

begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "jjp-openx"
gemspec.summary = "A Ruby interface to the OpenX XML-RPC API with more OpenX APIs used"
gemspec.description = "A Ruby interface to the OpenX XML-RPC API. Used touchlocal 1.1.2 version as base for adding more API calls to OpenX API from http://developer.openx.org/api/ . It also works with v2 of OpenX API, especially that it now can pass localTZ to the OpenX API which will give back the correct statistics for the local time zone."
gemspec.email = "jacobjp@mac.com"
gemspec.homepage = "http://github.com/DoppioJP/openx"
gemspec.authors = ["Aaron Patterson", "Andy Smith", "TouchLocal Plc", "DoppioJP"]
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end

$: << "lib/"
require 'openx'

HOE = Hoe.new('openx', OpenX::VERSION) do |p|
# p.rubyforge_name = 'ruby-openxx' # if different than lowercase project name
p.developer('Aaron Patterson', 'aaron.patterson@gmail.com')
end

namespace :openx do
task :clean do
include OpenX::Services
Expand All @@ -28,13 +38,3 @@ namespace :openx do
end
end
end

namespace :gem do
task :spec do
File.open("#{HOE.name}.gemspec", 'w') do |f|
f.write(HOE.spec.to_ruby)
end
end
end

# vim: syntax=Ruby
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.6
Loading