Index: trunk/fundraiser-statistics/fundraiser-scripts/mine_landing_pages.py |
— | — | @@ -46,11 +46,11 @@ |
47 | 47 | pathIndex = 2; |
48 | 48 | |
49 | 49 | |
| 50 | + # Clear the records for hour ahead of adding |
| 51 | + #timestamp_raw_start = year + month + day + hour + min + '00' |
| 52 | + #timestamp_raw_end = year + month + day + hour + min + '00' |
| 53 | + #clear_recs_query = 'delete from landing_page where request_time >= \'' + +'\' and request_time < \' \''; |
50 | 54 | |
51 | | - # INITIALIZE DB ACCESS |
52 | | - # =================== |
53 | | - |
54 | | - |
55 | 55 | # SQL Statements |
56 | 56 | |
57 | 57 | insertStmt_lp = 'INSERT INTO landing_page (utm_source, utm_campaign, utm_medium, landing_page,' + \ |
— | — | @@ -114,8 +114,12 @@ |
115 | 115 | project = hostname[0] # wikimediafoundation.org |
116 | 116 | source_lang = hostname[0] |
117 | 117 | else: |
118 | | - project = hostname[0] if ( hostname[1] == 'wikimedia' ) else hostname[1] # species.wikimedia vs en.wikinews |
119 | | - source_lang = hostname[0] if ( len(hostname[1]) < 5 ) else 'en' # pl.wikipedia vs commons.wikimedia |
| 118 | + try: |
| 119 | + project = hostname[0] if ( hostname[1] == 'wikimedia' ) else hostname[1] # species.wikimedia vs en.wikinews |
| 120 | + source_lang = hostname[0] if ( len(hostname[1]) < 5 ) else 'en' # pl.wikipedia vs commons.wikimedia |
| 121 | + except: |
| 122 | + project = '' |
| 123 | + source_lang = 'en' |
120 | 124 | |
121 | 125 | # Process User agent string |
122 | 126 | # ===================== |