Index: trunk/fundraiser-statistics/fundraiser-scripts/fundraiser_reporting.py |
— | — | @@ -48,8 +48,8 @@ |
49 | 49 | def init_db(self): |
50 | 50 | """ Establish connection """ |
51 | 51 | #db = MySQLdb.connect(host='db10.pmtpa.wmnet', user='rfaulk', db='faulkner') |
52 | | - self.db = MySQLdb.connect(host='127.0.0.1', user='rfaulk', db='faulkner', port=3307) |
53 | | - #self.db = MySQLdb.connect(host='storage3.pmtpa.wmnet', user='rfaulk', db='faulkner') |
| 52 | + #self.db = MySQLdb.connect(host='127.0.0.1', user='rfaulk', db='faulkner', port=3307) |
| 53 | + self.db = MySQLdb.connect(host='storage3.pmtpa.wmnet', user='rfaulk', db='faulkner') |
54 | 54 | |
55 | 55 | """ Create cursor """ |
56 | 56 | self.cur = self.db.cursor() |
— | — | @@ -435,8 +435,8 @@ |
436 | 436 | def __init__(self, *args): |
437 | 437 | |
438 | 438 | if len(args) == 2: |
439 | | - self.campaign = campaign |
440 | | - self.start_time = start_time |
| 439 | + self.campaign = args[0] |
| 440 | + self.start_time = args[1] |
441 | 441 | else: |
442 | 442 | self.campaign = None |
443 | 443 | self.start_time = None |
— | — | @@ -563,9 +563,9 @@ |
564 | 564 | |
565 | 565 | # Current date & time |
566 | 566 | now = datetime.datetime.now() |
567 | | - UTC = 8 |
568 | | - delta = datetime.timedelta(hours=UTC) |
569 | | - now = now + delta |
| 567 | + #UTC = 8 |
| 568 | + #delta = datetime.timedelta(hours=UTC) |
| 569 | + #now = now + delta |
570 | 570 | |
571 | 571 | # ESTABLISH THE START TIME TO PULL ANALYTICS |
572 | 572 | hours_back = 24 |
Index: trunk/fundraiser-statistics/reporting/custom_campaign_plot.php |
— | — | @@ -34,17 +34,16 @@ |
35 | 35 | $cmpgn=$_POST["utm_campaign"]; |
36 | 36 | |
37 | 37 | // generate plots |
38 | | -$home_path = './plot_build_latest.sh'; |
39 | | -$cmd_arr = array(); |
40 | 38 | $args = ' ' . $cmpgn . ' ' . $start; |
41 | | -$cmd = 'sh plot_build_latest.sh' . $args; |
| 39 | +// $cmd = 'echo "baggin5" | sudo -S ./plot_build_latest.sh' . $args; |
| 40 | +$cmd = './plot_build_latest.sh' . $args; |
42 | 41 | |
43 | | - |
44 | 42 | chdir('/home/rfaulk/fundraiser-statistics/bash/'); |
45 | | -// $output= shell_exec($cmd); |
46 | 43 | |
47 | 44 | // Execute the shell command |
48 | | -$output = shell_exec($cmd); |
| 45 | +//$output1 = shell_exec($cmd . ' 2>&1'); |
| 46 | +//$output2 = shell_exec('whoami'); |
| 47 | +$output = shell_exec('echo ' . $cmd. $args . ' >async_plotter.sh'); |
49 | 48 | |
50 | 49 | echo '<html>'; |
51 | 50 | echo '<head>'; |
— | — | @@ -52,8 +51,9 @@ |
53 | 52 | echo '</head>'; |
54 | 53 | echo '<body>'; |
55 | 54 | |
56 | | -echo $cmd . '<br>'; |
57 | | -echo $output . '<br>'; |
| 55 | +// echo $cmd . '<br>'; |
| 56 | +// echo $output . '<br>'; |
| 57 | +// echo $output2 . '<br>'; |
58 | 58 | echo 'Plots are generating, results will be up momentarily.<br>'; |
59 | 59 | echo '<a href="http://fundraising.wikimedia.org/stats/reporting_latest.html">Back to latest Reports</a><br>'; |
60 | 60 | |
Index: trunk/fundraiser-statistics/bash/plot_build_latest.sh |
— | — | @@ -10,4 +10,6 @@ |
11 | 11 | |
12 | 12 | cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_LP_metrics_don_per_view_latest.png /srv/org.wikimedia.fundraising/stats/ |
13 | 13 | cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_don_per_imp_latest.png /srv/org.wikimedia.fundraising/stats/ |
14 | | -cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_click_rate_latest.png /srv/org.wikimedia.fundraising/stats/ |
\ No newline at end of file |
| 14 | +cp /home/rfaulk/fundraiser-statistics/fundraiser-scripts/report_banner_metrics_click_rate_latest.png /srv/org.wikimedia.fundraising/stats/ |
| 15 | + |
| 16 | +echo "" > async_plotter.sh |
\ No newline at end of file |