User:Inge Hoonte/captain tweet: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
mNo edit summary
Line 1: Line 1:
After much circling around new ideas, while focusing on finishing Captain Tweet, I decided to let a few new kernels and smaller works wait for some other time. Aymeric has helped me steadily progress. And I'm starting to understand dictionaries and strings better.


After much circling around new ideas, I decided to just keep focusing on finishing Captain Tweet. Aymeric has helped me steadily progress. And I'm starting to understand dictionaries and strings better.
Some important things to note: <br/>
 
Some important things to note:
* I changed the original dates. ideally I'd have this air on December 16, the first entry of the original log. But for the sake of the show now, I've changed it to June/July. So... in case you're wondering, that's why it's snowing in July. But I guess this could be the case, had the ship been sailing via the Arctic or Greenland.  
* I changed the original dates. ideally I'd have this air on December 16, the first entry of the original log. But for the sake of the show now, I've changed it to June/July. So... in case you're wondering, that's why it's snowing in July. But I guess this could be the case, had the ship been sailing via the Arctic or Greenland.  
* The Weymouth, the ship that's tweeted from, was used to transport 11 parties of 1820 settlers from Portsmouth, England, to Algoa Bay (Port Elizabeth), South-East Africa.
* The Weymouth, the ship that's tweeted from, was used to transport 11 parties of 1820 settlers from Portsmouth, England, to Algoa Bay (Port Elizabeth), South-East Africa.
* A big undertone of this project is of course migration, sailing the seas, colonialism, which isn't further explored. I needed to focus on advancing in my programming skills.  
* A big undertone of this project is of course migration, sailing the seas, colonialism, which isn't further explored. I needed to focus on advancing in my programming skills.  


'''ORIGINAL LOG BY CAPTAIN TURNER, 1819/1820'''
'''ORIGINAL LOG BY CAPTAIN TURNER, 1819/1820'''  
Thurs 16 December 1819 – Portsmouth Harbour
Am: Light breezes and clear
8: Do weather. Employed hoisting in provisions and other necessary duties.
The settlers came on board at noon. Do weather. Employed stowing the hold.
Mustered for Checques, discharged several of the crew. Employed stowing the holds. Midnight: Strong winds


Fri 17 December
Thurs 16 December 1819 – Portsmouth Harbour <br/>
Am: Strong breezes with rain
Am: Light breezes and clear <br/>
8: Do weather. Employed cleaning decks and stowing chain cables.
8: Do weather. Employed hoisting in provisions and other necessary duties. <br/>
Do weather. Employed as before.
The settlers came on board at noon. Do weather. Employed stowing the hold. <br/>
Midnight: Do weather
Mustered for Checques, discharged several of the crew. Employed stowing the holds.  <br/>
Midnight: Strong winds <br/>


Sat 18 December
Fri 17 December <br/>
Am: Strong breezes and rain. Employed clearing lighter of provisions.
Am: Strong breezes with rain <br/>
Pm: More moderate employed cleaning decks.
8: Do weather. Employed cleaning decks and stowing chain cables. <br/>
Midnight: Fine weather
Do weather. Employed as before. <br/>
Midnight: Do weather <br/>
 
Sat 18 December <br/>
Am: Strong breezes and rain. Employed clearing lighter of provisions. <br/>
Pm: More moderate employed cleaning decks. <br/>
Midnight: Fine weather <br/>


'''CAPTAIN TWEET, 2011'''
'''CAPTAIN TWEET, 2011'''
06/16
01:00: Light breezes and clear
08:00: Ditto weather. Employed hoisting in provisions and other necessary duties.
15:00: The settlers came on board at noon. Ditto weather. Employed stowing the hold.
17:00: Mustered for Checques, discharged several of the crew. Employed stowing the holds.
23:59: Strong winds


06/17
06/16 <br/>
01:00: Strong breezes with rain
01:00: Light breezes and clear <br/>
08:00: Ditto weather. Employed cleaning decks and stowing chain cables.
08:00: Ditto weather. Employed hoisting in provisions and other necessary duties. <br/>
15:00: Ditto weather. Employed as before.
15:00: The settlers came on board at noon. Ditto weather. Employed stowing the hold. <br/>
23:59: Ditto weather
17:00: Mustered for Checques, discharged several of the crew. Employed stowing the holds. <br/>
23:59: Strong winds <br/>


06/18
06/17 <br/>
01:00: Strong breezes and rain. Employed clearing lighter of provisions.
01:00: Strong breezes with rain <br/>
15:00: More moderate employed cleaning decks.
08:00: Ditto weather. Employed cleaning decks and stowing chain cables. <br/>
23:59: Fine weather
15:00: Ditto weather. Employed as before. <br/>
23:59: Ditto weather <br/>


06/18 <br/>
01:00: Strong breezes and rain. Employed clearing lighter of provisions. <br/>
15:00: More moderate employed cleaning decks. <br/>
23:59: Fine weather <br/>


'''CODE'''
 
'''CODE''' <br/>


  #!/usr/bin/python
  #!/usr/bin/python
Line 55: Line 57:
   
   
  for day in days:
  for day in days:
daylog = day.split("\n")
daylog = day.split("\n")
day = daylog.pop(0)
day = daylog.pop(0)
 
entries = {}
entries = {}
for entry in daylog:
for entry in daylog:
  event = entry.split(" ")
  event = entry.split(" ")
  daytime = event.pop(0)
  daytime = event.pop(0)
  entries[daytime] = " ".join(event)
  entries[daytime] = " ".join(event)
 
 
log[day] = entries
log[day] = entries
  #datetime.now()
  #datetime.now()
   
   
Line 72: Line 74:
  print log['07/10']['06:00:']
  print log['07/10']['06:00:']


'''Anomalies'''
'''Anomalies''' <br/>
Born on Board, not mentioned in the Cpt Log, but present in the Master's Roll:
Born on Board, not mentioned in the Cpt Log, but present in the Master's Roll:


Jan 13 ___ Pedlar
Jan 13 ___ Pedlar <br/>
Jan 28 ___ Green
Jan 28 ___ Green <br/>
Feb 07 ___ Reed
Feb 07 ___ Reed <br/>
Feb 20 ___ Biggar
Feb 20 ___ Biggar <br/>
Feb 29 ___ Epsey
Feb 29 ___ Epsey <br/>
Mar 08 ___ Godfrey
Mar 08 ___ Godfrey <br/>
Mar 10 ___ Usher
Mar 10 ___ Usher <br/>
Mar 22 ___ Hobbs DD 13 Apr
Mar 22 ___ Hobbs DD 13 Apr <br/>
Apr 07 ___ Sweetman
Apr 07 ___ Sweetman <br/>
Apr 26 ___ Bowker
Apr 26 ___ Bowker <br/>
Apr 29 ___ Sanders DD 7 May
Apr 29 ___ Sanders DD 7 May <br/>
May 18 ___ Cronk
May 18 ___ Cronk <br/>


'''References'''
 
'''References''' <br/>
http://www.theshipslist.com/ships/passengerlists/weymouth.htm >> this is the source log by Captain Turner
http://www.theshipslist.com/ships/passengerlists/weymouth.htm >> this is the source log by Captain Turner
http://www.galapagos.to/TEXTS/BEAGLELOG.HTM
http://www.galapagos.to/TEXTS/BEAGLELOG.HTM
http://www.wielingen1991.org/en/mission_/log_book.htm  >> ship employed in war
http://www.wielingen1991.org/en/mission_/log_book.htm  >> ship employed in war
http://www.dailymail.co.uk/sciencetech/article-1218474/How-Captain-Cooks-ship-logs-helping-scientists-chart-global-climate-change.html
http://www.dailymail.co.uk/sciencetech/article-1218474/How-Captain-Cooks-ship-logs-helping-scientists-chart-global-climate-change.html




 
To Do: <br/>
To Do:
* update time in log to standardized 06:00 etc hours that Python can read
* update time in log to standardized 06:00 etc hours that Python can read
* create new twitter account for the captain  
* create new twitter account for the captain  

Revision as of 10:35, 16 June 2011

After much circling around new ideas, while focusing on finishing Captain Tweet, I decided to let a few new kernels and smaller works wait for some other time. Aymeric has helped me steadily progress. And I'm starting to understand dictionaries and strings better.

Some important things to note:

  • I changed the original dates. ideally I'd have this air on December 16, the first entry of the original log. But for the sake of the show now, I've changed it to June/July. So... in case you're wondering, that's why it's snowing in July. But I guess this could be the case, had the ship been sailing via the Arctic or Greenland.
  • The Weymouth, the ship that's tweeted from, was used to transport 11 parties of 1820 settlers from Portsmouth, England, to Algoa Bay (Port Elizabeth), South-East Africa.
  • A big undertone of this project is of course migration, sailing the seas, colonialism, which isn't further explored. I needed to focus on advancing in my programming skills.

ORIGINAL LOG BY CAPTAIN TURNER, 1819/1820

Thurs 16 December 1819 – Portsmouth Harbour
Am: Light breezes and clear
8: Do weather. Employed hoisting in provisions and other necessary duties.
The settlers came on board at noon. Do weather. Employed stowing the hold.
Mustered for Checques, discharged several of the crew. Employed stowing the holds.
Midnight: Strong winds

Fri 17 December
Am: Strong breezes with rain
8: Do weather. Employed cleaning decks and stowing chain cables.
Do weather. Employed as before.
Midnight: Do weather

Sat 18 December
Am: Strong breezes and rain. Employed clearing lighter of provisions.
Pm: More moderate employed cleaning decks.
Midnight: Fine weather

CAPTAIN TWEET, 2011

06/16
01:00: Light breezes and clear
08:00: Ditto weather. Employed hoisting in provisions and other necessary duties.
15:00: The settlers came on board at noon. Ditto weather. Employed stowing the hold.
17:00: Mustered for Checques, discharged several of the crew. Employed stowing the holds.
23:59: Strong winds

06/17
01:00: Strong breezes with rain
08:00: Ditto weather. Employed cleaning decks and stowing chain cables.
15:00: Ditto weather. Employed as before.
23:59: Ditto weather

06/18
01:00: Strong breezes and rain. Employed clearing lighter of provisions.
15:00: More moderate employed cleaning decks.
23:59: Fine weather


CODE

#!/usr/bin/python
#from datetime import datetime

log = {}
journal = open("log.txt","r")
days = journal.read().split("\n\n")

for day in days:
	daylog = day.split("\n")
	day = daylog.pop(0)
 
	entries = {}
	
	for entry in daylog:
	  event = entry.split(" ")
	  daytime = event.pop(0)
	  entries[daytime] = " ".join(event)
	  
	log[day] = entries
	
#datetime.now()


print log['07/10']['06:00:']

Anomalies
Born on Board, not mentioned in the Cpt Log, but present in the Master's Roll:

Jan 13 ___ Pedlar
Jan 28 ___ Green
Feb 07 ___ Reed
Feb 20 ___ Biggar
Feb 29 ___ Epsey
Mar 08 ___ Godfrey
Mar 10 ___ Usher
Mar 22 ___ Hobbs DD 13 Apr
Apr 07 ___ Sweetman
Apr 26 ___ Bowker
Apr 29 ___ Sanders DD 7 May
May 18 ___ Cronk


References
http://www.theshipslist.com/ships/passengerlists/weymouth.htm >> this is the source log by Captain Turner

http://www.galapagos.to/TEXTS/BEAGLELOG.HTM

http://www.wielingen1991.org/en/mission_/log_book.htm >> ship employed in war

http://www.dailymail.co.uk/sciencetech/article-1218474/How-Captain-Cooks-ship-logs-helping-scientists-chart-global-climate-change.html


To Do:

  • update time in log to standardized 06:00 etc hours that Python can read
  • create new twitter account for the captain
  • make friends for the captain
  • put code and log on the server, run it from there
  • add to code: #check for date continuously and time, when there's a match, push message from log to captain's tweet feed


OLD CODE

#!/usr/bin/python

import twitter
import time
api = twitter.Api(username='...', password='...')

print('Starting...')

while 1 == 1:
       api.PostUpdate(getoutput('uptime'))
       print(getoutput('uptime'))
       time.sleep(3600)