Changeset 231779
- Timestamp:
- 04/21/2010 08:30:36 PM (16 years ago)
- Location:
- google-adsense-summary/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (3 diffs)
-
google_adsense_summary.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
google-adsense-summary/trunk/README.txt
r231764 r231779 7 7 Requires at least: 2.9.2 8 8 Tested up to: 2.9.2 9 Stable version: 1.0. 210 Stable Tag: 1.0. 29 Stable version: 1.0.3 10 Stable Tag: 1.0.3 11 11 12 12 == Description == … … 28 28 **IMPORTANT** 29 29 30 Upgrade to 1.0. 2! Important Bug Fix. Please read the changelog before upgrading!30 Upgrade to 1.0.3! Important Bug Fix. Please read the changelog before upgrading! 31 31 32 32 == Features == … … 122 122 find ~ -type -f -name "adsense_*" -exec rm {} \; 123 123 This finds them and deletes them at the same time. Or you can use the rm command to take care of them 124 125 = 1.0.3 = 126 * Made it so that the cookie files are getting temporarily saved in the google-adsense-summary plugin directory. -
google-adsense-summary/trunk/google_adsense_summary.php
r231764 r231779 5 5 Description: Google Adsense Summary will check your adsense page and show you what you've earned. 6 6 It will display yesterdays, todays, this month, last month and last payment earnings. 7 Version: 1.0. 27 Version: 1.0.3 8 8 Author: agentc0re 9 9 Author URI: http://learnix.net … … 96 96 */ 97 97 $this->thispluginurl = PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)).'/'; 98 $this->thispluginpath = PLUGIN_PATH . '/' . dirname(plugin_basename(__FILE__)).'/'; 98 99 $this->thispluginpath = WP_PLUGIN_DIR.'/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__)); 99 100 100 101 //Actions … … 497 498 /////////////////////////////////////////////// 498 499 499 function curl_get($url , $cookiefile) {500 function curl_get($url) { 500 501 $this->curl = curl_init(); 501 502 curl_setopt($this->curl, CURLOPT_URL, $url); … … 514 515 /////////////////////////////////////////////// 515 516 516 function curl_post($url, $ cookiefile, $post) {517 function curl_post($url, $post) { 517 518 $this->curl = curl_init(); 518 519 curl_setopt($this->curl, CURLOPT_URL, $url); … … 531 532 function google_adsense_summary_retrieve_data() { 532 533 $gasOptions = $this->getAdminOptions(); 534 $cookietempdir = $this->thispluginpath; 533 535 $this->username = $gasOptions['username']; 534 536 $this->password = $gasOptions['password']; 535 $this->cookiefile = tempnam( sys_get_temp_dir(), "adsense_");537 $this->cookiefile = tempnam($cookietempdir, "adsense_"); 536 538 537 539 /** 538 540 * Get the GA3T value for login 539 541 */ 540 $data = $this->curl_get("https://www.google.com/accounts/ServiceLoginBox?service=adsense<mpl=login&ifr=true&rm=hide&fpui=3&nui=15&alwf=true&passive=true&continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&hl=en_US" , $this->cookiefile);542 $data = $this->curl_get("https://www.google.com/accounts/ServiceLoginBox?service=adsense<mpl=login&ifr=true&rm=hide&fpui=3&nui=15&alwf=true&passive=true&continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&hl=en_US"); 541 543 542 544 /** … … 553 555 * Login to AdSense 554 556 */ 555 $data = $this->curl_post("https://www.google.com/accounts/ServiceLoginBoxAuth", $this->cookiefile,"continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&service=adsense&nui=15&fpui=3&ifr=true&rm=hide<mpl=login&hl=en_US&alwf=true<mpl=login&GA3T=$ga3t[1]&GALX=$galx[1]&Email=$this->username&Passwd=$this->password");557 $data = $this->curl_post("https://www.google.com/accounts/ServiceLoginBoxAuth", "continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&service=adsense&nui=15&fpui=3&ifr=true&rm=hide<mpl=login&hl=en_US&alwf=true<mpl=login&GA3T=$ga3t[1]&GALX=$galx[1]&Email=$this->username&Passwd=$this->password"); 556 558 557 559 /** … … 590 592 * Authenticate login 591 593 */ 592 $data = $this->curl_get("https://www.google.com/accounts/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&hl=en_US&service=adsense<mpl=login&chtml=LoginDoneHtml" , $this->cookiefile);594 $data = $this->curl_get("https://www.google.com/accounts/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&hl=en_US&service=adsense<mpl=login&chtml=LoginDoneHtml"); 593 595 594 596 /** … … 656 658 */ 657 659 foreach($fetch_times as $key_times => &$report_times) { 658 $data = $this->curl_get("https://www.google.com/adsense/report/overview?timePeriod=$report_times" , $this->cookiefile);660 $data = $this->curl_get("https://www.google.com/adsense/report/overview?timePeriod=$report_times"); 659 661 preg_match_all("/<td nowrap valign=\"top\" style=\"text-align\:right\" class=\"\">(.*?)<\/td>/", $data, $match); 660 662 /**
Note: See TracChangeset
for help on using the changeset viewer.