Beispiel #1
0
args = argv[1:]
if len(args):
    line_number = int(args[0])
    lines = [lines[line_number]]

for line in lines:

    #extract relevant data8Mart from line
    data = {}
    for c in columns:
        if columns[c] < len(line):
            value = line[columns[c]]
            if run.is_numeric(value):
                value = int(value)
            data[c] = value
        else:
            data[c] = ''


    #construct command
    print "****** id", data['id'], ", retweets", data['retweets']
    id = get_id(data)

    if id:
        command = command_template.format(id=id)
        run.run_action(command.split(' '))

    #sleep for 1 second to comply with rate limits
    if pace_requests:
        time.sleep(1.5)
Beispiel #2
0
# do we just want to run a single line?
args = argv[1:]
if len(args):
    line_number = int(args[0])
    lines = [lines[line_number]]

for line in lines:

    #extract relevant data from line
    data = {}
    for c in columns:
        if columns[c] < len(line):
            value = line[columns[c]]
            if run.is_numeric(value):
                value = int(value)
            data[c] = value
        else:
            data[c] = ''

    #construct command
    print "****** id", data['id'], ", retweets", data['retweets']
    id = get_id(data)

    if id:
        command = command_template.format(id=id)
        run.run_action(command.split(' '))

    #sleep for 1 second to comply with rate limits
    if pace_requests:
        time.sleep(1.5)
Beispiel #3
0
from sys import argv
from client import run

run.run_action(argv[1:])