Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jongotlin/adrecordapiwrapper
Php wrapper for Adrecord's api
https://github.com/jongotlin/adrecordapiwrapper
Last synced: 30 days ago
JSON representation
Php wrapper for Adrecord's api
- Host: GitHub
- URL: https://github.com/jongotlin/adrecordapiwrapper
- Owner: jongotlin
- Created: 2014-09-24T09:12:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-08T12:00:19.000Z (over 10 years ago)
- Last Synced: 2024-12-04T07:42:23.423Z (about 2 months ago)
- Language: PHP
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AdrecordApiWrapper
==================Php wrapper for Adrecord's api
```php
use AdrecordApiWrapper\Adrecord;
use Guzzle\Http\Client;$client = new Client();
$adrecord = new Adrecord('36Ju9EWnFvplyqxV', $client);foreach ($adrecord->getChannels() as $channel) {
echo sprintf('%d: %s (%s)%s', $channel->getId(), $channel->getName(), $channel->getUrl(), PHP_EOL);
}
//4: Hittajulklappar (http://www.hittajulklappar.se)$channel = $adrecord->getChannel(4);
echo sprintf('%d: %s (%s)%s', $channel->getId(), $channel->getName(), $channel->getUrl(), PHP_EOL);
//4: Hittajulklappar (http://www.hittajulklappar.se)foreach ($adrecord->getPrograms() as $program) {
echo sprintf('%d: %s (%s)%s', $program->getId(), $program->getName(), $program->getUrl(), PHP_EOL);
}
//43: Blogvertiser (http://www.blogvertiser.com/sv/)$program = $adrecord->getProgram(43);
echo sprintf('%d: %s (%s)%s', $program->getId(), $program->getName(), $program->getUrl(), PHP_EOL);
//43: Blogvertiser (http://www.blogvertiser.com/sv/)$channel = new Channel();
$channel->setId(4);
$program = new Program();
$program->setId(196);
foreach ($adrecord->getTransactions($channel, $program, new DateTime('2014-09-01'), new DateTime('2014-09-10')) as $tx) {
echo date('Y-m-d', key($tx->getChanges())) . PHP_EOL;
}
//2014-09-01
```