Account Loop Ping

Script that adds time.

Script that get all the users on the system, sets their mins.


In [12]:
import os
import json
import socket
from TwitterFollowBot import TwitterBot

In [14]:
brobeurtw = TwitterBot('/home/wcmckee/github/wcmckee-notebook/config.txt')

In [15]:
brobeurtw.send_tweet()


Out[15]:
<TwitterFollowBot.TwitterBot at 0x72666bf0>

In [ ]:


In [ ]:


In [2]:
myhn = socket.gethostname()

In [3]:
myhn


Out[3]:
'raspberrypi'

In [ ]:


In [4]:
lisho = os.listdir('/home')

In [5]:
lisho


Out[5]:
['pi', 'wcmckee']

In [6]:
usertimdict = dict()

In [16]:
compdict = dict()

In [ ]:


In [18]:
for ish in lisho:
    #usertimdict.update({ish : 0})
    compdict.update({myhn : {ish : 0}})

In [19]:
compdict


Out[19]:
{'raspberrypi': {'wcmckee': 0}}

In [20]:
jstim  = json.dumps(compdict)

In [21]:
jstim


Out[21]:
'{"raspberrypi": {"wcmckee": 0}}'

In [22]:
opus = open('/home/wcmckee/sellcoffee/hostnames/' + myhn, 'w')

opus.write(jstim)

opus.close()

In [ ]:


In [ ]: