Example #1
0
Date:           16/March/2015
Python version: 3.4
"""

from datetime import datetime

import ons_twitter.cluster as cl


# start counting time
start_time = datetime.now()
print("Starting clustering: ", start_time, "\n")

# specify mongodb databases
mongo_address = ("192.168.0.98:30001", "twitter", "address")

twitter_data = ("192.168.0.99:30000", "twitter", "tweets")

# start clustering
user_no = cl.cluster_all(twitter_data, mongo_address, parallel=True, debug=False, num_cores=-1)

# print information at the end
print(
    "\n  ****\nFinished clustering at: ",
    datetime.now(),
    "\n in: ",
    datetime.now() - start_time,
    "\n Found users:",
    user_no,
)
Example #2
0
Description:    Run clustering algorithm on all valid tweets in the dataset.
                Attach address info and cluster info to all tweets.
Author:         Bence Komarniczky
Date:           16/March/2015
Python version: 3.4
"""

from datetime import datetime

import ons_twitter.cluster as cl

# start counting time
start_time = datetime.now()
print("Starting clustering: ", start_time, "\n")

# specify mongodb databases
mongo_address = ("192.168.0.98:30001", "twitter", "address")

twitter_data = ("192.168.0.99:30000", "twitter", "tweets")

# start clustering
user_no = cl.cluster_all(twitter_data,
                         mongo_address,
                         parallel=True,
                         debug=False,
                         num_cores=-1)

# print information at the end
print("\n  ****\nFinished clustering at: ", datetime.now(), "\n in: ",
      datetime.now() - start_time, "\n Found users:", user_no)
Example #3
0
"""
Description: test this2
Author: Bence Komarniczky
Date:
Python version: 3.4
"""

from datetime import datetime

import ons_twitter.cluster as cl


start_time = datetime.now()


mongo_address = (("127.0.0.1:27017", "twitter", "address"),
                 ("192.168.0.82:27017", "twitter", "address"),
                 ("192.168.0.62:28001", "twitter", "address"),
                 ("192.168.0.87:28000", "twitter", "address"),
                 ("192.168.0.97:28002", "twitter", "address"))
#
# mongo_address = ("192.168.0.82:27017", "twitter", "address")

test_twitter_mongo = ("127.0.0.1:27017", "test", "tweets")

if __name__ == "__main__":
    cl.cluster_all(mongo_connection=test_twitter_mongo,
                   mongo_address=mongo_address)

print(datetime.now() - start_time)