dejurin / lametric-adsense
La Metric 的 Adsense(非官方)
1.0.0
2019-03-10 18:52 UTC
Requires
- php: >=5.6
- filebase/filebase: ^1.0
- league/oauth2-google: ^3.0
This package is auto-updated.
Last update: 2024-09-11 15:13:34 UTC
README
您可以推送或显示数据。
La Metric 的 Adsense(非官方)
入门指南
- 访问 https://console.developers.google.com 创建 Client ID OAuth 2.0
- 创建新应用 https://developer.lametric.com/applications/createdisplay
运行 http 服务器进行推送
cd ~/public_html
$ php -S localhost:8000
example.php
<?php require 'vendor/autoload.php'; $LMA = new \Dejurin\LaMetric_Adsense([ 'clientId' => '', // Google Client Id 'clientSecret' => '', // Google Client Secret 'redirectUri' => 'https://:8000/'.basename(__FILE__).'?auth', 'accessType' => 'offline', ], '', // La Metric: Access Token '', // La Metric: URL for pushing data to all __DIR__.'/db', // DB path basename(__FILE__) // current filename ); if (isset($_GET['auth'])) { $LMA->auth(); } elseif (isset($_GET['accounts'])) { $LMA->accounts(); } elseif (isset($_GET['show'])) { $LMA->show(); } elseif (isset($_GET['push'])) { $LMA->push(); } else { $LMA->index(); }