This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT merger.nid, | |
| Group_concat(categories SEPARATOR '') AS categories, | |
| Group_concat(types SEPARATOR '') AS types, | |
| merger.created, | |
| mapping.alias AS name | |
| FROM ((SELECT ti.nid, | |
| ti.tid, | |
| ti.created, | |
| Group_concat(td.name SEPARATOR '|') AS categories, | |
| '' AS types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| req = {'limit' : 100, | |
| 'start_time': '2012-06-12T010:30-5:00', | |
| 'include_profile' : 'false', | |
| 'end_time': '2014-06-13T10:30-5:00', | |
| 'page': PAGE_NUM} | |
| r=requests.get(r'https://secure.mcommons.com/api/messages',auth=('USERNAME','PASSWORD'),data=req) | |
| print r.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pymongo import MongoClient | |
| from datetime import datetime | |
| import requests | |
| from bs4 import BeautifulSoup | |
| import time | |
| messages = {} | |
| client = MongoClient() | |
| db = client.test1 | |
| coll = db.testData | |
| start = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #explain extended | |
| select | |
| mc.phone_number, | |
| mc.email, | |
| mc.first_name, | |
| mc.last_name, | |
| mc.geocoded_postal_code, | |
| mc.city, | |
| mc.all_campaigns, | |
| mc.first_campaign, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| substring(source_name, 1, 14) as sourceNum, | |
| count(*) as Number | |
| from | |
| data.mcomm | |
| where | |
| source_type = 'Tell A Friend' | |
| group by substring(source_name, 1, 14) | |
| having count(*) > 1 | |
| order by count(*); |