Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 59 lines (36 sloc) 4.96 kB
b0461e2 @scottjacksonx Updated the readme.
authored
1 # Hu #
2
af4abe0 @scottjacksonx Hello, Hu.
authored
3 >"Smells like fish," Scheme said.
4 >Another splotch of ink.
5 >"You're writing this down, right Hu?"
6 >*What?*
7 >"My observations. What I eat and drink. Smells. You're supposed to be taking notes."
8 >*Oh. Right.* (Another splotch.) *Wait, why?*
9 >"You never see the pattern as it's happening. Once, I kept track of everything I ate for six months and found out I had Thai food every nine days, like clockwork."
10 >I started retroactively building a database. Although it only had one entry: an espresso at the Black Danube --
11 >"And I want to correlate everything. When do I have the best ideas? When am I clever, and conversely, when can't I form a complete sentence? What have I been eating, drinking, absorbing? How much have I been sleeping?"
12
13 -- *Annabel Scheme*, by Robin Sloan.
14
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
15 HUGIN-19.LG.GRAILGRID.NET (a.k.a. Hu) is the narrator of Robin Sloan's *Annabel Scheme*. In the excerpt above, we see the kinds of things that Hu, an AI Watson to Scheme's Holmes, is capable of doing and recording.
b0461e2 @scottjacksonx Updated the readme.
authored
16
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
17 **I am making Hu.** A rudimentary version of Hu, sure, but Hu nonetheless. Every ten minutes, I want my computer to take a snapshot of what's going on -- what time it is, what software I have open, what websites I'm looking at, how many unread emails I have, what music I've been listening to, which files are open, how long/big those files are (to track my work's progress), what the weather's like, what I've eaten (via services like Daytum), etc. From there, I can look at trends, graph things, measure things, and try to spot patterns.
af4abe0 @scottjacksonx Hello, Hu.
authored
18
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
19 What's more, Hu has a plugin architecture -- after all:
af4abe0 @scottjacksonx Hello, Hu.
authored
20
aa5204a @scottjacksonx Updated readme.
authored
21 > *I can interface with anything! I'm infinitely extensible...*
22
dc99598 @scottjacksonx Updated the readme.
authored
23 Want Hu to record how many items are in your trash can? Write a little bit of code that checks how many items are in the trash can and tell Hu you want that data recorded. Ditto for recording your weight. Or your computer's remaining battery life. Or how many events are on your calendar for today ("do I work better when I've got long stretches of time to work in, or do I get my best work done in little chunks of time?").
aa5204a @scottjacksonx Updated readme.
authored
24
bb25ef2 @scottjacksonx Updated the readme.
authored
25 This is all wishlist stuff, though. Don't get your hopes up too high just yet.
aa5204a @scottjacksonx Updated readme.
authored
26
e69fa6e @scottjacksonx Updated the readme.
authored
27 # Using Hu #
28
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
29 Hu is a little bit delicate at the moment.
d3c67ab @scottjacksonx Updated the readme.
authored
30
577b804 @scottjacksonx Adding plugins to me is easier now. Now you just have to drag 'n' dro…
authored
31 To use Hu, first [download the source](http://github.com/scottjacksonx/hu/zipball/master). Then, change your values for the various plugins (your last.fm username for the `hu_lastfm` plugin, your location for the `hu_googleweather` plugin, etc.). Finally, run `$ python hu.py`. That will run Hu once. Hu's notes are stored in `hu-notes.txt`.
e69fa6e @scottjacksonx Updated the readme.
authored
32
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
33 # Plugins #
bb25ef2 @scottjacksonx Updated the readme.
authored
34
577b804 @scottjacksonx Adding plugins to me is easier now. Now you just have to drag 'n' dro…
authored
35 Hu has a plugin architecture. When Hu runs, the first thing that happens is that he looks for every folder with a name that starts with `"hu_"` and treats that folder as a plugin.
bb25ef2 @scottjacksonx Updated the readme.
authored
36
577b804 @scottjacksonx Adding plugins to me is easier now. Now you just have to drag 'n' dro…
authored
37 Here's how you write a plugin:
38
39 1. You come up with a name for your plugin (with plugins, as with bands, coming up with a name is the hardest part). We'll call it `$PLUGIN`. When you see `$PLUGIN` from here on out, substitute your own plugin's name. **_Nota bene_: your plugin's name must start with "hu_" for the reason outlined just above.**
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
40 2. You write a python script called `$PLUGIN`.py that contains a definition of a function called `getData()`. You can include other functions, classes or any other kind of code, but you _must_ define a function called `getData()`. `getData()` returns exactly what is recorded in Hu's entry, so it should be XML, complete with newlines (no newline necessary at the end). No tabs/spaces are necessary, since that's carried out from within `hu.py`.
41 3. Put `$PLUGIN`.py inside a folder called `$PLUGIN`. The `$PLUGIN` folder lives inside the `hu` folder.
42 4. Inside the `$PLUGIN` folder, have a file called `__init__.py`, which contains a single line of code: `import $PLUGIN`
bb25ef2 @scottjacksonx Updated the readme.
authored
43
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
44 That's all there is to it. If you're having any issues, look at how the default plugins (`hu_googleweather`, `hu_openapps`, etc.) work.
bb25ef2 @scottjacksonx Updated the readme.
authored
45
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
46 # The Potential #
295f324 @scottjacksonx Updated the readme.
authored
47
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
48 Once Hu has a bunch of information about you, here are the kinds of things you can start to ask:
295f324 @scottjacksonx Updated the readme.
authored
49
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
50 - What application do I spend the most time in? Find the most commonly occurring frontmost application.
51 - What websites do I visit the most often? Get the most frequently-appearing domain.
577b804 @scottjacksonx Adding plugins to me is easier now. Now you just have to drag 'n' dro…
authored
52 - How much of what I do at the Coffee Shop With the WiFi is work, and how much is refreshing Hacker News?
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
53 - How does the weather affect the kind of music I listen to? Compare the list of songs you listened to when the weather was "Cloudy" to the songs you listened to when the weather was "Fine."
54 - What time of day do I listen to music most at? See how many songs I listened to between 6pm and 12am and compare that number with how many songs I listened to between 9am and 3pm.
4e62fbe @scottjacksonx Updated the readme.
authored
55
86ed3b5 @scottjacksonx Take two. I'm no longer a script. I'm a class now. I'm all growned up…
authored
56 At the moment, you have to ask those questions at the command-line using your `sed`, `awk` and `grep` fu. I plan on making searching and querying Hu a bit easier later on, but until then, you'll have to speak bleep-blorp like a robot.
84c0771 @scottjacksonx Updated readme.
authored
57
58
Something went wrong with that request. Please try again.