Index: trunk/fundraiser-statistics/fundraiser-scripts/classes/DataMapper.py |
— | — | @@ -50,6 +50,9 @@ |
51 | 51 | |
52 | 52 | """ |
53 | 53 | Copies mining logs from remote site for a given hour |
| 54 | + |
| 55 | + @param type: specifies whether the log contains banner or landing page requests |
| 56 | + @type type: string |
54 | 57 | """ |
55 | 58 | def copy_logs(self, type, **kwargs): |
56 | 59 | |
— | — | @@ -583,8 +586,8 @@ |
584 | 587 | #print landing_url |
585 | 588 | include_request, index_str_flag = self.evaluate_landing_url(landing_url, parsed_landing_url, query_fields, path_pieces) |
586 | 589 | #print [include_request, index_str_flag] |
| 590 | + |
587 | 591 | |
588 | | - |
589 | 592 | if include_request: |
590 | 593 | |
591 | 594 | """ Address cases where the query string contains the landing page - ...wikimediafoundation.org/w/index.php?... """ |
— | — | @@ -647,7 +650,7 @@ |
648 | 651 | utm_source = 'NONE' |
649 | 652 | utm_campaign = 'NONE' |
650 | 653 | utm_medium = 'NONE' |
651 | | - |
| 654 | + |
652 | 655 | # INSERT INTO landing_page ('utm_source', 'utm_campaign', 'utm_medium', 'landing_page', 'page_url', 'lang', 'project', 'ip') values () |
653 | 656 | try: |
654 | 657 | val = '(' + start_timestamp_in + ',\'' + utm_source + '\',\'' + utm_campaign + '\',\'' + utm_medium + '\',\'' + landing_page + \ |
— | — | @@ -736,6 +739,19 @@ |
737 | 740 | |
738 | 741 | """ |
739 | 742 | Parses the landing url and determines if its valid |
| 743 | + |
| 744 | + @param landing_url: full landing page url |
| 745 | + @type landing_url: string |
| 746 | + |
| 747 | + @param parsed_landing_url: landing_url parsed into components |
| 748 | + @type parsed_landing_url: dictionary |
| 749 | + |
| 750 | + @param query_fields: query string field values |
| 751 | + @type query_fields: dictionary |
| 752 | + |
| 753 | + @param path_pieces: url path components |
| 754 | + @type path_pieces: list |
| 755 | + |
740 | 756 | """ |
741 | 757 | def evaluate_landing_url(self, landing_url, parsed_landing_url, query_fields, path_pieces): |
742 | 758 | |
— | — | @@ -752,7 +768,7 @@ |
753 | 769 | Evaluate conditions which determine acceptance of request based on the landing url |
754 | 770 | """ |
755 | 771 | try: |
756 | | - c1 = re.search('WMF', path_pieces[2] ) != None or re.search('Junetesting001', path_pieces[2] ) != None |
| 772 | + c1 = re.search('WMF', path_pieces[2] ) != None or re.search('Junetesting001', path_pieces[2] ) != None or re.search('L11', path_pieces[2] ) |
757 | 773 | c2 = re.search('Hear_from_Kartika', path_pieces[2]) != None |
758 | 774 | |
759 | 775 | cond1 = parsed_landing_url[hostIndex] == 'wikimediafoundation.org' and path_pieces[1] == 'wiki' and (c1 or c2) |