Plugin Directory

Changeset 231779


Ignore:
Timestamp:
04/21/2010 08:30:36 PM (16 years ago)
Author:
agentc0re
Message:

Changed the path where cookies were being stored to the plugin directory

Location:
google-adsense-summary/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • google-adsense-summary/trunk/README.txt

    r231764 r231779  
    77Requires at least:  2.9.2
    88Tested up to:  2.9.2
    9 Stable version:  1.0.2
    10 Stable Tag: 1.0.2
     9Stable version:  1.0.3
     10Stable Tag: 1.0.3
    1111
    1212== Description ==
     
    2828**IMPORTANT**
    2929
    30 Upgrade to 1.0.2!  Important Bug Fix.  Please read the changelog before upgrading!
     30Upgrade to 1.0.3!  Important Bug Fix.  Please read the changelog before upgrading!
    3131
    3232== Features ==
     
    122122find ~ -type -f -name "adsense_*" -exec rm {} \;
    123123This 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  
    55Description: Google Adsense Summary will check your adsense page and show you what you've earned.
    66It will display yesterdays, todays, this month, last month and last payment earnings.
    7 Version: 1.0.2
     7Version: 1.0.3
    88Author: agentc0re
    99Author URI: http://learnix.net
     
    9696            */
    9797            $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__));
    99100
    100101            //Actions
     
    497498        ///////////////////////////////////////////////
    498499
    499         function curl_get($url, $cookiefile) {
     500        function curl_get($url) {
    500501            $this->curl = curl_init();
    501502            curl_setopt($this->curl, CURLOPT_URL, $url);
     
    514515        ///////////////////////////////////////////////
    515516
    516         function curl_post($url, $cookiefile, $post) {
     517        function curl_post($url, $post) {
    517518            $this->curl = curl_init();
    518519            curl_setopt($this->curl, CURLOPT_URL, $url);
     
    531532        function google_adsense_summary_retrieve_data() {
    532533            $gasOptions = $this->getAdminOptions();
     534            $cookietempdir = $this->thispluginpath;
    533535            $this->username = $gasOptions['username'];
    534536            $this->password = $gasOptions['password'];
    535             $this->cookiefile = tempnam(sys_get_temp_dir(), "adsense_");
     537            $this->cookiefile = tempnam($cookietempdir, "adsense_");
    536538
    537539            /**
    538540            * Get the GA3T value for login
    539541            */
    540             $data = $this->curl_get("https://www.google.com/accounts/ServiceLoginBox?service=adsense&ltmpl=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&ltmpl=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");
    541543
    542544            /**
     
    553555            * Login to AdSense
    554556            */
    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&ltmpl=login&hl=en_US&alwf=true&ltmpl=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&ltmpl=login&hl=en_US&alwf=true&ltmpl=login&GA3T=$ga3t[1]&GALX=$galx[1]&Email=$this->username&Passwd=$this->password");
    556558
    557559            /**
     
    590592            * Authenticate login
    591593            */
    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&ltmpl=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&ltmpl=login&chtml=LoginDoneHtml");
    593595
    594596            /**
     
    656658            */
    657659            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");
    659661                preg_match_all("/<td nowrap valign=\"top\" style=\"text-align\:right\" class=\"\">(.*?)<\/td>/", $data, $match);
    660662                /**
Note: See TracChangeset for help on using the changeset viewer.