2017 © Pedro Peláez
 

library woopra

Woorpa PHP SDK

image

aamortimer/woopra

Woorpa PHP SDK

  • Monday, September 22, 2014
  • by aamortimer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Woopra PHP SDK

This library allows you to more easily comunicate with the Woopra API, (*1)

Installing via Composer

The recommended way to install Woopra SDK is through Composer., (*2)

# Install Composer
curl -sS https://getcomposer.org/installer | php

# Add Woopra as a dependency

composer require aamortimer/woopra:dev-master

After installing, you need to require Composer's autoloader:, (*3)

require 'vendor/autoload.php';

Helpers

Started adding some helper functions to make it easier to get at the data quickly., (*4)

// setup namespace
use aamortimer\Woopra\Woopra;

// get all the labels that have been setup
Woopra::getAllLabels(array('app-id'=>'', 'secret-key'=>'', 'website'=>''), function($labels){
  print_r($labels);
});

// you can also return data from the function rather then using a callback
$labels = Woopra::getAllLabels(array('app-id'=>'', 'secret-key'=>'', 'website'=>''));

// get all user labels
// search parameter should be an email address or session id
Woopra::getUserLabels(array('app-id'=>'', 'secret-key'=>'', 'website'=>'', 'search'=>''), function($labels){
  print_r($labels);
});

// you can also return data from the function rather then using a callback
$labels = Woopra::getUserLabels(array('app-id'=>'', 'secret-key'=>'', 'website'=>'', 'search'=>''));

Search API

All methods of the search API are supported to see further details and the options available visit (https://www.woopra.com/docs/developer/search-api/), (*5)

// setup namespace
use aamortimer\Woopra\Search;

// set up the search class
$search = new Search(array(
  'app-id' => 'YOUR APP ID HERE',
  'secret-key' => 'YOUR SECRET KEY HERE'
));

// user data
$website = 'example.com';

// search all data for domain
$rsp = $search->search(array(
  'website'=>$website
));
print_r($rsp);

// search by name
$rsp = $search->search(array(
  'website'=>$website,
  'search'=>'Bob Marley'
));
print_r($rsp);

// look up a profile
$rsp = $search->profile(array(
  'website'=>$website,
  'email'=>'test@example.com'
));
print_r($rsp);

// profile visits
$rsp = $search->profileVisits(array(
  'website'=>$website,
  'email'=>'test@example.com',
  'start_day'=>date('Y-m-d', strtotime('- 10 days')),
  'end_day'=>date('Y-m-d')
));
print_r($rsp);

// edit profile data
$rsp = $search->profileEdit(array(
  'website'=>$website,
  'email'=>'test@example.com',
  'data'=>'{"name":"john smith", "age": 33}'
));
print_r($rsp);

// online count
$rsp = $search->onlineCount(array(
  'website'=>$website
));
print_r($rsp);

Labels API

Only the list methods of the labels API is supported to see further details and the options available visit (https://www.woopra.com/docs/developer/labels-api/), (*6)

// setup namespace
use aamortimer\Woopra\userData;

// set up the search class
$labels = new UserData(array(
  'app-id' => 'YOUR APP ID HERE',
  'secret-key' => 'YOUR SECRET KEY HERE'
));

$rsp = $labels->show(array(
  'website'=>'example.com'
));

Analytics API

All methods of the analytics API are supported to see further details and the options available visit (https://www.woopra.com/docs/developer/analytics-api/), (*7)

// setup namespace
use aamortimer\Woopra\Analytics;

// set up the search class
$analytics = new Analytics(array(
  'app-id' => 'YOUR APP ID HERE',
  'secret-key' => 'YOUR SECRET KEY HERE'
));


// get report
$report = [
  'group_by'=>array(
    array('key'=>'time', 'scope'=>'visits')
  ),
  'columns'=>array(
    array('name'=>'People', 'method'=>'count', 'scope'=>'visitors'),
    array('name'=>'Actions', 'method'=>'count', 'scope'=>'actions')
  )
];

$this->analytics->report(array(
  'website' => 'example.com',
  'report' => $report,
  'start_day'=>date('Y-m-d', strtotime('-1 Day')),
  'end_day'=>date('Y-m-d')
));

The Versions

22/09 2014

dev-master

9999999-dev https://github.com/aamortimer/Woopra

Woorpa PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Andy Mortimer

php woopra

22/09 2014

v1.0.2

1.0.2.0 https://github.com/aamortimer/Woopra

Woorpa PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Andy Mortimer

php woopra

22/09 2014

v1.0.1

1.0.1.0 https://github.com/aamortimer/Woopra

Woorpa PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Andy Mortimer

php woopra

09/09 2014

v1.0.0

1.0.0.0 https://github.com/aamortimer/Woopra

Woorpa PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Andy Mortimer

php woopra