Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Now definitely only works with Safari. Would love to get Firefox supp…

…ort, but Firefox and AppleScript don't play nicely.
  • Loading branch information...
commit 6d427b84c94ea8351a17df3919cbf997a6c6644c 1 parent bb25ef2
@scottjacksonx authored
Showing with 9 additions and 8 deletions.
  1. +0 −1  hu-notes/.test
  2. +9 −7 hu.py
View
1  hu-notes/.test
@@ -1 +0,0 @@
-I have to put a file in /hu-notes, otherwise git won't let me add the directory to the repository.
View
16 hu.py
@@ -7,7 +7,6 @@
myLocation = "brisbane,australia"
myLastFmUsername = "scottjacksonx"
-myBrowser = "safari"
def getWeather(location):
"""
@@ -42,7 +41,7 @@ def getRecentTracks(username):
return tracksFromLastTenMinutes
-def getOpenBrowserTabs(browser):
+def getOpenBrowserTabs():
"""
Gets the title and URL of every tab open in the specified web browser.
"""
@@ -58,12 +57,14 @@ def getCurrentApp():
def takeSnapshot():
"""
- Makes a new file named after the timestamp it was created at and records the weather and recently-listened-to tracks.
+ Makes a new file named after the timestamp it was created at and records everything that's going on.
"""
# get current time.
currentTime = int(time.time())
+
# make and open new file for that time.
- newFile = open("hu-notes/hu-" + str(currentTime), "w")
+ newFile = open("hu-notes.txt", "a")
+ newFile.write("\n")
# put time in file
snapshotTime = str(time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime()))
@@ -85,9 +86,10 @@ def takeSnapshot():
newFile.write("\n")
# put current tabs in file.
- newFile.write(str(getOpenBrowserTabs(myBrowser)))
+ newFile.write(str(getOpenBrowserTabs()))
+
+ newFile.write("----\n")
newFile.close()
-takeSnapshot()
-
+takeSnapshot()

0 comments on commit 6d427b8

Please sign in to comment.
Something went wrong with that request. Please try again.