1 # twitching, an Emacs client for Twitter
3 Twitching is an Emacs Twitter client to get tweets from a user's
8 Twitching was written with two primary goals in mind:
10 1. Get tweets from all followed users without losing any.
11 2. The ability to filter some tweets from the timeline.
15 1. Periodically download your timeline and show them in a buffer.
17 3. Navigate easily through your tweets. Use Emacs's `C-s` and `C-r` to
19 4. Filters - probably the best feature of twitching. If you're really
20 irritated that all your tweets have something annoying like
21 `#RoyalWedding`, set up a filter on that hashtag and your Twitter
22 feed is cleared of all tweets with it. Filters are persistent so
23 future tweets that match will also be filtered away.
24 5. Remove - Same as filters but without persistence.
25 6. Group - This provides a way to show all your tweets ordered by the
26 tweeters. Comes in two flavors: group all tweets, or group only the
27 tweets of a single user.
28 7. Follow/UnFollow users.
29 8. Open a hashtag in a browser. If you see a few tweets with
30 [#interviewswithhari](http://twitter.com/#!/search/%23interviewswithhari)
31 and want to see more you can open it up on the browser. This is
32 currently not supported as viewing in Emacs.
33 9. Open a user mention in the browser. Same as 8, but for user
35 10. Copy specific parts of a tweet and put it into the
36 `kill-ring`. For example, `c t` copies the tweet text, and `c s`
37 copies the current tweet's status id.
41 Twitching does not provide a way to perform any of Twitter's "social
44 As is right now, there is no way to compose a tweet, reply to a tweet
45 or retweet. There's no way to get tweets where you're mentioned
48 Contributions to do these are of course welcome. They aren't on the
53 See the TODO file included with the package for details on upcoming
58 Before you use twitching, you must have a Twitter consumer token and
59 consumer token secret. If you don't already have one, see the section
60 below on Getting a consumer-key and consumer-secret for details.
64 To use twitching, put the files `twitching.el`, `oauth.el`, `json.el`
65 and `hmac-sha1.el` in a directory and add this directory to your Emacs
68 Add the below lines to your `.emacs` file.
70 ;;; Twitter mode in Emacs
71 (add-to-list 'load-path "/path/to/twitching")
72 (autoload 'start-twitching "twitching" "Start Twitching timer" t)
73 (autoload 'twitching-show-favorites "twitching" "show favorite tweets" t)
74 (autoload 'twitching-home-timeline-get "twitching" "Get Twitter home page" t)
77 ### Downloading tweets
79 #### Downloading your home timeline once
81 To just download your tweets, do `M-x twitching-home-timeline-get`.
82 This will work even if the timer is running.
84 Your tweets will be shown in the buffer `*Twitching*`.
86 #### Periodically downloading tweets
88 To periodically fetch your tweets type `M-x start-twitching`. This
89 will start a timer that downloads your tweets periodically and put
90 them in the buffer `*Twitching*`.
92 The default value of this timer is set to run every 5 minutes, but it
93 can be customized by changing the value of
94 `*twitching-timer-interval*`. Simply add the following line to your
97 (setq *twitching-timer-interval* SECONDS)
99 where `SECONDS` is the new interval period. If you have already
100 started the timer, you will need to stop it and start it again for the
101 new interval to take effect.
103 ##### Stopping the timer
105 `M-x stop-twitching` stops the timer.
109 The first time that you start twitching, it will first ask you to
110 enter your Twitter consumer key and Twitter consumer secret. (See
111 below for details on getting these.) After this, twitching will open
112 up a browser window which will ask you to enter your username and
113 password. Enter it and authorize your app. After this, you will be
114 shown a 7 digit number on the browser. Enter this at the Emacs
115 minibuffer and your tweets will get downloaded.
117 This will happen only the first time that twitching starts.
119 If you want to stop entering the consumer key and consumer secret each
120 time that you start Emacs, you can add them to your start up script
121 using the following commands
123 (setq *twitching-api-consumer-key* "YOUR CONSUMER KEY"
124 *twitching-api-consumer-secret* "YOUR CONSUMER SECRET")
128 You can go to the next tweet by using any of the following keys:
129 `C-n`, `n`, down-arrow or `j`. To nagivate to the previous tweet, you
130 can use any of the keys: `C-p`, `p`, up-arrow or `k`. These commands
131 support prefix arguments, so `C-u 5 j` will move down five tweets.
133 To scroll down a page, you can use `C-v`, SPC or Page Down. You can
134 scroll up a page using `M-v`, Backspace, or Page Up.
136 (Quick note: Emacs defines two commands `scroll-up` and `scroll-down`
137 which do the exact inverse of what Page Up and Page Down do. For
138 Emacs, the command `scroll-up` scrolls _contents_ up but Page Up
139 scrolls the cursor up. Here the terms "scroll up" and "scroll down",
140 refer to the common meanings associated with Page Up and Page Down
143 #### Difference with Twitter Web interface
145 In Twitter's web interface, newer tweets are shown above older ones.
146 In twitching older tweets are shown first with new ones appended to
151 Tweets can be favorited by typing `s` on a tweet. If a tweet is
152 favorited, it will have a star shown next to it. If `s` is pressed on
153 an already favorited tweet, twitching will unfavorite the tweet.
157 To view all your favorited tweets, use the command
158 `twitching-show-favorites`. Upon invocation, your favorite tweets are
159 downloaded and shown in the buffer `*Favorite Tweets*`. With a prefix
160 argument, the command switches to the buffer immediately after it has
163 ### Opening links, hashtags and mentions
167 To open a link on a tweet, move point to it and press `o`. If there
168 are multiple links in a tweet they can be opened with a prefix
169 argument. For instance, to open the 3rd link in a tweet, type `C-u 3
170 o` or, more simply, `C-3 o`.
172 To open all links in a tweet, simply type `O`. The links will open up
173 in your default browser.
175 #### Opening hashtags
177 Opening hashtags work the same way as opening links. To open the first
178 hashtag in a tweet, use the key binding `#` and to open the _nth_
179 hashtag, use a prefix argument as `C-u` _n_ `#`.
181 #### Opening user mentions
183 Opening user mentions work the same way as opening links. To open the
184 first user mention in a tweet, use the key binding `@` and to open the
185 _nth_ hashtag, use a prefix argument as `C-u` _n_ `@`.
187 ### Getting a consumer-key and consumer-secret
189 To get your own `consumer-key` and `consumer-secret`, go to
190 [https://dev.twitter.com/apps/new](https://dev.twitter.com/apps/new) and
191 register a new application.
193 Select **Application Type** as **Client** and **Default Access Type**
194 as **Read & Write**. **Read only** will also work but favoriting
195 tweets will not be possible. Filtering, grouping and other features
198 #### Why such an elaborate route?
200 If you write a Twitter client, you're expected to encode the
201 consumer-key and consumer-secret within your application in such a way
202 that your users do not have access to them. Obviously, this does not
203 work well with Free Software programs.
205 ## Displaying User Profile images
207 To enable display of user profile pictures along with their tweets,
208 add the following line to your `.emacs` file after the customizations
209 mentioned in the section Usage.
211 (setq *twitching-profile-use-p* t)
213 Twitching will lazily download the user profile images and store them
214 in your filesystem. So immediately after enabling this feature, your
215 twitching buffer will still show your tweets without any profile
216 images. The images will show up in time.
218 The profile images are stored in the directory specified by the
219 variable `*twitching-profile-directory*`. By default, it evaluates to
220 `~/.emacs.d/twitching/thumbnails`.
222 ### Lack of image support in Windows
224 By default, Emacs does not ship with support for JPEG, PNG or GIF
225 formats. See the answer to the question "3.3 How do I get image
227 [Emacs FAQ for Windows](http://www.gnu.org/software/emacs/windows/Installing-Emacs.html).
229 To enable image support on Windows, I have found
230 [GnuWin32](http://gnuwin32.sourceforge.net/) useful. I downloaded the
233 * [GifLib](http://gnuwin32.sourceforge.net/packages/giflib.htm) -
234 support for GIF files
235 * [Jpeg](http://gnuwin32.sourceforge.net/packages/jpeg.htm) -
236 support for JPEG files
237 * [LibPng](http://gnuwin32.sourceforge.net/packages/libpng.htm) -
238 support for PNG files. This has a dependency on ZLib. The page has
239 a link to its dependencies.
241 Extracted the contents of the above packages and place them in your
242 `EMACS_HOME/bin` folder. The next time you start a new instance of
243 Emacs, it should have support to display images.
245 To check if your Emacs supports images, you can run the following from
246 Emacs. Type `M-:` and paste the following in the minibuffer
247 `(image-type-available-p 'jpeg)`. If you see a `t` printed, it means
248 you have support to display JPEG files. The corresponding commands for
249 GIF and PNG are `(image-type-available-p 'gif)` and
250 `(image-type-available-p 'png)` respectively.
254 `twitching` is licensed under the terms of the GPLv3 (or later). This
255 means you're free to use it for personal and commercial use, you're
256 free to copy it and give copies away, and you're free to modify and
257 redesign the source code, and to create derivative works. For
258 details, read the contents of the file LICENSE distributed with
260 [http://www.gnu.org/license s/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html).