toneflix-code/adf-ly-laravel
Composer 安装命令:
composer require toneflix-code/adf-ly-laravel
包简介
A laravel package that wraps around Adf.ly API library.
README 文档
README
This library is a simple laravel package that wraps around Adf.ly API implementations.
Please refere to Adf.ly API Documentation for detailed api use description.
Requirements
Installation
You can install the package via composer:
composer require toneflix-code/adf-ly-laravel
Service Provider & Facade (Optional on Laravel 5.5+)
Register provider and facade on your config/app.php file.
'providers' => [ ..., ToneflixCode\AdfLy\AdfLyServiceProvider::class, ] 'aliases' => [ ..., 'AdfLy' => ToneflixCode\AdfLy\AdfLyFacade::class, ]
Configuration (Optional)
php artisan vendor:publish --provider="ToneflixCode\AdfLy\AdfLyServiceProvider"
API Keys
To start using this library you are required to configure your API keys in your .env file with these variables
ADFLY_SECRET_KEY=your-adf.ly secret key
ADFLY_PUBLIC_KEY=your-adf.ly public key
ADFLY_USER_ID=your-adf.ly user ID
Usage
Shorten Url
use ToneflixCode\AdfLy\AdfLy; $adfly = new AdfLy; $res = $adfly->shorten(array('http://stackoverflow.com/users'), 'q.gs'); $shortenedUrl1 = $res['data'][0]; $hash1 = substr($shortenedUrl1['short_url'],strrpos($shortenedUrl1['short_url'],'/')+1); echo 'First URL shortened (' . $hash1 . '): ' . print_r($res); $res = $adfly->shorten(array('http://www.reddit.com'), 'q.gs'); $shortenedUrl2 = $res['data'][0]; $hash2 = substr($shortenedUrl2['short_url'],strrpos($shortenedUrl2['short_url'],'/')+1); echo 'Another URL shortened (' . $hash2 . '): ' . print_r($res); $res = $adfly->shorten(array('www.youtube.com'), 'q.gs', 'banner'); $shortenedUrl3 = $res['data'][0]; echo 'Another URL shortened: ' . print_r($res); $res = $adfly->shorten(array('http://www.len10.com/videos/'), 'q.gs', 'int', 13); $shortenedUrl4 = $res['data'][0]; echo 'Another URL shortened: ' . print_r($res);
Parameters
function shorten( array $urls, $domain = false, $advertType = false, $groupId = false, $title = false, $customName = false )
Expand.
print_r($adfly->expand(array($shortenedUrl3['short_url'],$shortenedUrl4['short_url']),array($hash1,$hash2)));
LISTING
// List Urls $urlList = $adfly->getUrls(); print_r($urlList); // Update Url $adfly->updateUrl($shortenedUrl1['id'], 'http://modifiedurlaaaa.cat', "int", "The updated URL", 13, false, false); print_r($adfly->expand(array(),array($hash1))); foreach($urlList['data'] as $url){ $adfly->deleteUrl($url['id']); } //List Urls again $urlList = $adfly->getUrls(); print_r($urlList);
GROUPS
$g = $adfly->createGroup('API Group'); print_r($g); $g = $adfly->getGroups(1); print_r($g);
REFERRERS GET
$res = $adfly->getReferrers(); print_r($res);
COUNTRIES GET
$res = $adfly->getCountries(); print_r($res);
ANNOUNCEMENTS GET
$res = $adfly->getAnnouncements(); print_r($res);
publisherReferralStats GET
$res = $adfly->getPublisherReferrals(); print_r($res);
advertiserReferralStats GET
$res = $adfly->getAdvertiserReferrals(); print_r($res,1);
withdrawalTransactions GET
$res = $adfly->getWithdrawalTransactions(); print_r($res,1);
withdraw GET
$res = $adfly->getWithdraw(); print_r($res,1);
withdraw request GET
$res = $adfly->withdrawRequestInitiate(); print_r($res,1);
withdraw request DELETE
$res = $adfly->withdrawRequestCancel(); print_r($res,1);
publisher Stats GET
$res = $adfly->getPublisherStats(); print_r($res,1);
user Profile GET
$res = $adfly->getProfile(); print_r($res,1);
advertiser Campaigns GET
$res = $adfly->getAdvertiserCampaigns(); print_r($res,1);
advertiser Graph GET
$res = $adfly->getAdvertiserGraph(null,156); print_r($res,1);
advertisers Campaign parts GET
$res = $adfly->getAdvertiserCampaignParts(739026); print_r($res,1);
auth POST
$res = $adfly->auth('1', '2'); print_r($res,1);
account publisher referrals
$res = $adfly->getAccountPubReferrals('', '', 1); print_r($res);
account advertiser referrals
$res = $adfly->getAccountAdvReferrals('', '', 1); print_r($res);
account popad referrals
$res = $adfly->getAccountPopReferrals('', '', 1); print_r($res);
account total referrals
$res = $adfly->getAccountTotalReferrals(); print_r($res);
Domains
$res = $adfly->getDomains(); print_r($res);
update account details
$res = $adfly->updateAccountDetails([]); print_r($res);
update account password
$res = $adfly->updatePassword('oldpassword', 'newpassword', 'newpassword'); print_r($res);
get account countries
$res = $adfly->getAccountCountries(); print_r($res);
get account details
$res = $adfly->getAccountDetails(); print_r($res);
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email code@toneflix.com.ng instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
toneflix-code/adf-ly-laravel 适用场景与选型建议
toneflix-code/adf-ly-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 05 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「toneflix」 「adf.ly」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 toneflix-code/adf-ly-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 toneflix-code/adf-ly-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 toneflix-code/adf-ly-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Fileable exposes methods that make handling file upload with Laravel filesystem even easier, it also exposes a trait that automatically handles file uploads for you.
Alfabank REST API integration
Laravel Fileable exposes methods that make handling file upload with Laravel filesystem even easier, it also exposes a trait that automatically handles file uploads for you.
Laravel OP is a simple fork of Laravel that provides a set of tools to help you build your Laravel application faster and easier. It is a collection of useful classes, traits, and functions that I have found useful in my own projects. It is a work in progress and I will be adding more features as I
Allows you to use fontawsome 5 icons in your php project.
Laravel package for Accurate Online API integration.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-22