Post on 24-Oct-2015
description
transcript
Cambodia, Independence Day
Twittering Mode(http://www.emacswiki.org/emacs?search=%22TwitteringMode%22)Talk (http://www.emacswiki.org/emacs/Comments_on_TwitteringMode)
1. Description
2. Installation Guide
1. For Windows users
2. For Linux and other Unix users
3. Set up your Emacs
4. Run twitteringmode
3. Keybindings on View mode
1. Move the cursor on the current timeline
2. Apply some operation to the current timeline
3. Open other timeline
4. Post a tweet
5. Invoke an external browser
6. Change display mode
7. Others
4. Keybindings on Edit mode
5. Timeline spec
1. Basic timeline
2. Direct message
3. Favorite
4. Hashtag
5. Retweet
6. Search
(http://www.emacswiki.org/)SiteMap (http://www.emacswiki.org/emacs/SiteMap) Search (http://www.emacswiki.org/emacs/Search)
ElispArea (http://www.emacswiki.org/emacs/ElispArea)
HowTo (http://www.emacswiki.org/emacs/HowTo) Glossary (http://www.emacswiki.org/emacs/Glossary)
RecentChanges (http://www.emacswiki.org/emacs/RecentChanges)
News (http://www.emacswiki.org/emacs/News) Problems (http://www.emacswiki.org/emacs/Problems)
Suggestions (http://www.emacswiki.org/emacs/Suggestions)
7. Alias
6. Initial timeline
7. Customizing your key bindings
8. Other useful options
9. URL shortening service
10. Enabling Spell Check for Tweets
11. Numbering mode
12. Discussion
Descriptiontwitteringmode.el is a Twitter client
(http://www.emacswiki.org/emacs/TwitteringModeScreenshot)
Home page: http://twmode.sourceforge.net/ (http://twmode.sourceforge.net/)
Github page: http://github.com/hayamiz/twitteringmode/tree/master (http://github.com/hayamiz/twittering
mode/tree/master)
git clone git://github.com/hayamiz/twitteringmode.git
Installation GuideFor Windows users
Uncompress the archive file, and add a path of a directory containing `twitteringmode.el` to your `loadpath`.
For example, if you uncompressed it under `C:\foo\`, there may be a directory `C:\foo\twitteringmodeX.X.X\` whichcontains `twitteringmode.el`. So add the following code to your `.emacs`
(addtolist 'loadpath "C:/foo/twitteringmodeX.X.X")
Proceed to Set up your Emacs
For Linux and other Unix usersUncompress the archive file, and add a path of a directory containing `twitteringmode.el` to your `loadpath`.
For example, if you uncompressed it under `/path/to/foo`, there may be a directory `/path/to/foo/twitteringmodeX.X.X/` which contains `twitteringmode.el`. So add the following code to your `.emacs`
(addtolist 'loadpath "/path/to/foo/twitteringmodeX.X.X")
NOTE: For twitteringmode2.0.0, if you have the latest emacs (or version 22 or later), you only need to put twittering
mode.el in your load path; you do not need the other directories or files that are in the archive file. For example, if you
have this in your `.emacs`:
(addtolist 'loadpath "~/.emacs.d/sitelisp/")
just
mv twitteringmode2.0.0/twitteringmode.el ~/.emacs.d/sitelisp/
Install cURL, wget, gnutls, or openssl for using SSL connection.
Proceed to Set up your Emacs
Set up your EmacsAdd following code to your `.emacs`:
(require 'twitteringmode)
(Optional) To avoid having to authorize twitteringmode everytime you run it, add this to your `.emacs`:
(setq twitteringusemasterpassword t)
This requires GnuPG (http://www.emacswiki.org/emacs/GnuPG). And also, either EasyPG
(http://www.emacswiki.org/emacs/EasyPG) or alpaca.el (0.13) is necessary.
(Optional) You may need to point twitteringmode to your system’s CA certificate bundle. On CentOS?
(http://www.emacswiki.org/emacs?action=edit;id=CentOS) 6 I added this to my `.emacs`:
(setq twitteringcertfile "/etc/ssl/certs/cabundle.crt")
Run twitteringmode1. Execute `Mx twit` to run twitteringmode.
2. Open OAuth authorization page with your browser, click “Allow”, and enter the PIN code. If you use the master
password, the PIN code is required only at the first time.
3. (Optional) Input the passphrase if you use the master password. This is required only at the first time.
4. Your friends’ timeline will appear. You can also open other timelines by ‘V’ with timelinespec. Enjoy!
Keybindings on View mode‘Mx twit’, and you enter to this mode. You can see various timelines.
Move the cursor on the current timeline‘j’Go to the next tweet. If the cursor placed on the oldest tweet, older tweets are retrieved. You can specify how manytweets will be retrieved by the variable ‘twitteringnumberoftweetsonretrieval’.( ‘twitteringgotonextstatus’)‘k’Go to the previous tweet. ( ‘twitteringgotopreviousstatus’)‘n’Go to the next tweet whose author is the same as the current tweet. ( ‘twitteringgotonextstatusofuser’)‘p’Go to the previous tweet whose author is the same as the current tweet. ( ‘twitteringgotopreviousstatusofuser’)‘l’Go to the next character. ( ‘forwardchar’)‘h’Go to the previous character. ( ‘backwardchar’)‘0’Go to the beginning of the current line. ( ‘beginningofline’)
`^’Go to the beginning of the text on the current line. ( ‘beginningoflinetext’)
`$’Go to the end of the current line. ( ‘endofline’)‘Ci’Go to the next username, URI, or timeline symbol. ( ‘twitteringgotonextthing’)‘MCi’, `<backtab>’Go to the previous username, URI, or timeline symbol. ( ‘twitteringgotopreviousthing’)
`<backspace>’, ‘Mv’Scroll down. ( ‘twitteringscrolldown’)
`<space>’, ‘Cv’Scroll up. ( ‘twitteringscrollup’)‘H’Go to the beginning of the current buffer. ( ‘twitteringgotofirststatus’)‘G’Go to the end of the current buffer. ( ‘endofbuffer’)
Apply some operation to the current timeline‘g’Retrieve new tweets of the current timeline. ( ‘twitteringcurrenttimeline’)
‘r’Display replied tweets related to the current tweet. ( ‘twitteringtoggleshowrepliedstatuses’)‘Cc D’Delete the current tweet. You can delete only yours. ( ‘twitteringdeletestatus’)‘Cc Ce’Remove all tweets of the current timeline from Emacs cache. ( ‘twitteringeraseoldstatuses’)‘q’Kill the current timeline buffer. ( ‘twitteringkillbuffer’)
Open other timelineIf you open a new timeline, a new buffer is generated.
‘v’Open a timeline pointed by the cursor. ( ‘twitteringotherusertimeline’)‘V’Open a various timeline. You can specify the timeline by timelinespec. ( ‘twitteringvisittimeline’)For convenience, there are following shortcuts.
‘Cc Cf’ Open your friendstimeline. ( ‘twitteringfriendstimeline’)
‘Cc Cu’ Open your usertimeline. ( ‘twitteringusertimeline’)
‘Cc Cr’ Open your replytimeline, which consists of replies to your tweets. ( ‘twitteringrepliestimeline’)
‘Cc Cd’ Open direct messages timeline, which consists of direct messages to you. ( ‘twitteringdirectmessagestimeline’)
‘L’Open a timeline of a certain list. ( ‘twitteringotheruserlistinteractive’)‘Cc Cq’Search. ( ‘twitteringsearch’)‘f’Switch to the next timeline buffer. ( ‘twitteringswitchtonexttimeline’)‘b’Switch to the previous timeline buffer. ( ‘twitteringswitchtoprevioustimeline’)
Post a tweet‘u’, ‘Cc Cs’Post a tweet. ( ‘twitteringupdatestatusinteractive’)‘Cm’, ‘Enter’Post a reply to the tweet pointed by the cursor. If the cursor points a URI, invoke ‘browseurl’ for the URI.( ‘twitteringenter’)‘Cc Cm’, ‘Cc Enter’Post a nonofficial (organic) retweet for the tweet pointed by the cursor. ( ‘twitteringretweet’)‘Cu Cc Cm’, ‘Cu Cc Enter’Post a official (native) retweet for the tweet pointed by the cursor. ( ‘twitteringretweet’)‘d’
Send a direct message. ( ‘twitteringdirectmessage’)
Invoke an external browser`<mouse1>’Open user page or URI by ‘browseurl’. ( ‘twitteringclick’)‘Cc Cv’Open the pointed user’s page by ‘browseurl’. ( ‘twitteringviewuserpage’)
Change display mode‘a’Toggle automatic retrieval of the current timeline. ( ‘twitteringtoggleactivatebuffer’)‘i’Toggle displaying icons of the current timeline. ( ‘twitteringiconmode’)‘s’Toggle scroll mode for the current timeline. ( ‘twitteringscrollmode’)‘t’, ‘Cc Cp’Toggle proxy. ( ‘twitteringtoggleproxy’)
Others‘Cc Ct’Set the current hashtag. ( ‘twitteringsetcurrenthashtag’)‘Cc Cl’Post the message “λかわいいよλ”(“Lambda is cute, lambda.”). ( ‘twitteringupdatelambda’)
`C<mouse3>’Push the current tweet to killring. ( ‘twitteringpushtweetontokillring’)‘U’Push the URL of the current tweet to killring. ( ‘twitteringpushuriontokillring’)
Keybindings on Edit mode‘Mp’Replace a tweet being edited with the previous tweet on history. ( ‘twitteringeditprevioushistory’)‘Mn’Replace a tweet being edited with the next tweet on history. ( ‘twitteringeditnexthistory’)
`<f4>’Shorten the URL pointed by the cursor. ( ‘twitteringeditreplaceatpoint’)‘Cc Ck’Cancel editing a tweet. ( ‘twitteringeditcancelstatus’)‘Cc Cc’Post the current tweet. ( ‘twitteringeditpoststatus’)
Timeline spec
When pressing ‘V’ ( ‘twitteringvisittimeline’), you can open any timeline with timeline spec. Since
twitteringmode stores the history of visited timelines, EmacsSession
(http://www.emacswiki.org/emacs/EmacsSession) and incremental backward search on the prompt of ‘V’( ‘twitteringvisittimeline’) may be useful when you open a timeline which you have opened.
The timeline spec can be used anywhere you have to specify a timeline.
Basic timeline:homethe home timeline.:mentionsthe timeline consisting of tweets mentioning you.:publicthe public timeline.
USERthe timeline consisting of tweets posted by USER.
USER /LISTNAMEthe list timeline owned by USER and named LISTNAME.
Direct message:direct_messagesthe timeline consisting of direct messages sent to you.:direct_messages_sentthe timeline consisting of direct messages that you sent.
Favorite:favoritesthe timeline consisting of tweets that you marked as a favorite.:favorites/USERthe timeline consisting of tweets that USER marked as a favorite.
Hashtag#HASHTAGthe timeline consisting of tweets including #HASHTAG.
Retweet:retweeted_by_meretweets that you posted.:retweeted_by_user/USER(only on development version) retweets that USER posted.:retweeted_to_me
retweets sent to your home timeline.:retweeted_to_user/USER(only on development version) retweets sent to USER’s home timeline.:retweets_of_meyour tweets that have been retweeted by others.
Search:search/QUERYSTRING /the timeline consisting of tweets matching QUERYSTRING. In QUERYSTRING, / (slash) and \ (backslash) mustbe escaped as \/ or \\.
AliasYou can define an alias for timeline spec. By defining a short alias as a long timeline spec, you can refer it more
easily. There are two types of alias, fixed and functional as below. Both types are defined in the association list bound
to the variable ‘twitteringtimelinespecalias’.
$ALIASNAMEthe timeline spec bound to ALIASNAME in ‘twitteringtimelinespecalias’.$ALIASNAME (ARGUMENT )the timeline spec generated by calling the function, which is bound to ALIASNAME in ‘twitteringtimelinespecalias’, with the argument ARGUMENT. The function can be specified as a symbol or a lambda expression.Functions must receive one string argument.
As an example, consider the following definition of ‘twitteringtimelinespecalias’.
(setq twitteringtimelinespecalias '(("FRIENDS" . "myaccount/friendslist") ("relatedto" . (lambda (username) (if username (format ":search/to:%s OR from:%s OR @%s/" username username username) ":home"))) ("relatedtotwitter" . "$relatedto(twitter)")))
With this configuration, you can use the below aliases.
alias equivalent
$FRIENDS myaccount/friendslist
$relatedto :home
$relatedto(twitterapi) :search/to:twitterapi OR from:twitterapi OR @twitterapi/
$relatedtotwitter :search/to:twitter OR from:twitter OR @twitter/
You can use an alias on defining other aliases, but a definition including a circularreference is forbidden.
Initial timelineBy setting the ‘twitteringinitialtimelinespecstring’, you can specify timelines that should be opened
initially. Timelines are specified by timelinespec as follows.
(setq twitteringinitialtimelinespecstring '(":home" ":replies" ":favorites" ":direct_messages" ":search/emacs/" "user_name/list_name"))
Customizing your key bindingsYou can use ‘twitteringmodehook’ to customize your configuration. This example shows how to define a few
key bindings:
(addhook 'twitteringmodehook (lambda () (mapc (lambda (pair) (let ((key (car pair)) (func (cdr pair))) (definekey twitteringmodemap (readkbdmacro key) func))) '(("F" . twitteringfriendstimeline) ("R" . twitteringrepliestimeline) ("U" . twitteringusertimeline) ("W" . twitteringupdatestatusinteractive)))))
Other useful options (setq twitteringiconmode t) ; Show icons (setq twitteringtimerinterval 300) ; Update your timeline each 300 seconds (5 minutes) (setq twitteringurlshowstatus nil) ; Keeps the echo area from showing all the http processes
twitteringmode also provides hooks that are run when new tweets arrive. This example calls notifysend (included in
the libnotify package) to display a message when new tweets arrive:
(addhook 'twitteringnewtweetshook (lambda () (let ((n twitteringnewtweetscount)) (startprocess "twitteringnotify" nil "notifysend" "i" "/usr/share/pixmaps/gnomeemacs.png" "New tweets" (format "You have %d new tweet%s" n (if (> n 1) "s" ""))))))
URL shortening serviceThe default URL shortening service for twitteringmode2.0.0 is tinyurl.com.
You can use bit.ly (or j.mp); add these lines to your `.emacs`
(setq twitteringtinyurlservice 'bit.ly)(setq twitteringbitlylogin "YOURbitlyUsername")(setq twitteringbitlyapikey "YOURbitlyAPIkey")
If your not sure what your username is, look at your bit.ly “Public Timeline” to find it →
https://bitly.com/u/USERNAME (https://bitly.com/u/USERNAME)
Find your API Key in bit.ly settings.
You can also set your default short domain (e.g., j.mp) in the bit.ly settings.
Enabling Spell Check for TweetsAdd the hook below to enable spell checking before tweets
(addhook 'twitteringeditmodehook (lambda () (ispellminormode) (flyspellmode)))
Numbering modetwitteringnumbering.el (https://github.com/pft/elispassorted/blob/master/twitteringnumbering.el) lets one navigate to
links using numbers, the same way as is done in emacsw3m.
Discussionhalloleo (http://www.emacswiki.org/emacs/halloleo): i’m trying this mode and it works pretty good, but i’m not
sure how to completely finish using twitter. does ‘q’ ( ‘twitteringsuspend’) do this? i don’t think so: it only
switches to another buffer, therefore the twitter timer still retrieves tweets…
citizen428 (http://www.emacswiki.org/emacs/citizen428): @halloleo Have you tried ‘Mx twitteringstop’?
RichardRiley (http://www.emacswiki.org/emacs/RichardRiley) : What packages are needed for icon support? Also,
wouldnt
(definekey km "q" 'deletewindow)
be a good addition?
For icon support, try adding (twitteringiconmode) to your .emacs – AlbertoGarcia
(http://www.emacswiki.org/emacs/AlbertoGarcia)
You need wget for icon support on Linux. it can take a while to download icons so be patient RichardRiley
(http://www.emacswiki.org/emacs/RichardRiley).
That’s a bug IMHO. The problem is that icons are downloaded while the timeline is being displayed on screen, so
the first time a new user appears in your timeline, you won’t see their icon because it’s still being downloaded.
You have to wait till the next refresh (or press “g” to force it) – AlbertoGarcia
(http://www.emacswiki.org/emacs/AlbertoGarcia).
I’m just wondering if I have missed something obvious. The default is to see your friends tweets. But how do I
tweet to my tweet account from there? Currently I have to go to my timeline (Cc Cu)) and then hitting return : is
there a quicker way? – RichardRiley (http://www.emacswiki.org/emacs/RichardRiley).
You can use the somewhat nonobvious keybinding of Cc Cs (twitteringupdatestatusinteractive).
Icon support does not work in windows. I have gnu wget installed and in path, and the icons are downloading to
twitteringtmpdir. However, they do not display in icon mode. Tim Hoolihan
Icon Works on Windows needs GNU Win32 image packages (http://gnuwin32.sourceforge.net/packages.html
(http://gnuwin32.sourceforge.net/packages.html)) installed, which includes jpeg, libungif, libpng, xpm, and zlib,
etc. And the packages dir must be set into the %PATH% environment various.
BTW: I wish this code would support HTTPS and thirdparty API in the future. It would be very useful. Moses
I wish twitteringmode would support socket proxy. I only use tor to connect twitter. rix
I wrote some patches so that iconmode works well without external programs, wget and convert. You can get it
from my repository on github http://github.com/cvmat/twitteringmode/tree/withoutexternalprogram
(http://github.com/cvmat/twitteringmode/tree/withoutexternalprogram) . I confirmed it with NTEmacs on
Windows XP and Emacs on Debian. – Tadashi MATSUO
Sorry for my rudeness. At last, I found tor+privoxy can make a http proxy. privoxy’s default proxy port is 8118.
rix
hayamiz has merged my patches into the main repository. The main repository
http://github.com/hayamiz/twitteringmode/tree/master (http://github.com/hayamiz/twitteringmode/tree/master)
now supports iconmode without external programs. Tadashi MATSUO
Any chance we can have a count of characters while tweeting in the minibuffer? (twit.el has this, I should look at
how it’s done)
If you use 0.9.0, the count is displayed in default. If you use the latest version on github, you may need the
following statement in your .emacs; (setq twitteringuseshowminibufferlength t) But the option is t in default…
Tadashi MATSUO
I can’t see my followee’s retweets. I’m following @ebertchicago(Roger Ebert, a film critik), but can’t see his
massive retweets. Can anybody tell me how can I fix it? Jeongtae Roh
Do you use 0.9.0? In default, it retrieves friends timeline, which does not include native retweets unless the
special option is embedded in the request (described at http://dev.twitter.com/doc/get/statuses/friends_timeline
(http://dev.twitter.com/doc/get/statuses/friends_timeline) ). I recommend you to use the latest version on github.
It supports home timeline, which includes native retweets. Tadashi MATSUO
Suddenly I get this error message from my twitteringmode client. Strange thing is it was working fine before. Any
clues?
error in process sentinel: Search failed: “^M? ^M?
Thanks in advance.
The version 0.9.0 seems to have some problems on dealing of newlines. But your problem, which is also reported
by other people, may be triggered by recent modification on twitter.com because this problem seems to appear
recently. The latest version on github will solve the problem. Tadashi MATSUO
How do I avoid having to authorize the app once and again when using OAuth? – AlbertoGarcia
(http://www.emacswiki.org/emacs/AlbertoGarcia).
With the HEAD version on github, you can store the authorized token with encryption by GnuPG
(http://www.emacswiki.org/emacs/GnuPG). If you have an encrypted token, you no longer need to retrieve PIN
code via web browser. Instead, you need to input a pass phrase for decryption. You can enable this function by
the following code.
(setq twitteringusemasterpassword t)
It requires GnuPG (http://www.emacswiki.org/emacs/GnuPG) and either EasyPG
(http://www.emacswiki.org/emacs/EasyPG) or ‘alpaca.el’. Please refer to NEWS file on the HEAD
(http://github.com/hayamiz/twitteringmode/blob/master/NEWS) – Tadashi MATSUO
I have just installed 1.0 after removing 0.8. When I use Mx twit to enter twmode, I just get “Authorization via
OAuth failed. Type Mx twit to retry.” in the minibuffer, and an empty :home buffer. This is unhelpful. What can I
do to actually authorize? I can’t have emacs launch a browser: my emacs session lives on a distant machine and
I access it strictly in text, as a dumb tty. – Krinn
It is because Twitter has changed the CA certificate required for server authentication of api.twitter.com and
search.twitter.com. The CA certificate embedded in 1.0.0 fails. The HEAD and the most recent revision on 1.0.x
branch on github have new CA certificate, which can authenticate the servers. – Tadashi MATSUO
20100905133600: I get just the “Authorization via…” message even with the github checkout, don’t see any
page to open etc. Which page should I open in an external browser? – JJ
The URL must be displayed on the buffer opened just after Mx twit. Then it will be opened by ‘browseurl’ if
you allow it. I do not know how to reproduce your case. The HEAD on github may help you. – Tadashi MATSUO
Fiddled around with the hook and wrote one I think is more useful than the suggested. I also used ToDoChiKu
(http://www.emacswiki.org/emacs/ToDoChiKu) so it should work with growl, snarl, and libnotify.
(addhook 'twitteringnewtweetshook (lambda () (let ((n twitteringnewtweetscount)) (if (> n 10) (todochikumessage (twitteringtimelinespectostring twitteringnewtweetsspec) (format "You have %d new tweet%s" n (if (> n 1) "s" "")) (todochikuicon 'social)) (dolist (el twitteringnewtweetsstatuses) (todochikumessage (twitteringtimelinespectostring twitteringnewtweetsspec) (concat (cdr (assoc 'userscreenname el)) " said: " (cdr (assoc 'text el))) (todochikuicon 'social)))))))
When more than 10 tweets are retrieved, it makes a message with the spec as the title and the number of tweets
in the message. If it gets less than 10, a message is made of each. Hope someone else finds it useful. –
DaveKerschner (http://www.emacswiki.org/emacs/DaveKerschner)
How can this code works for display only when I receive a mention?. – Exal
20100923 I also installed v1.0 and it works fine on my Linux system but not on my Windows system (get same
“Authorization via OAuth failed. Type Mx twit to retry.” message). It is the same exact setup that I sync
w/unison. Is there something special needed for Windows? Ed
For SSL connection, Emacs requires an external program. Do you have ‘curl’, `gnutls_cli’ or ‘openssl’ in
execpath? By the way, I recommend the HEAD on github. It supports encrypted local storage of authorized key
and xAuth. You need not to take a PIN code repeatedly. Note that `curl.exe’ (for Windows) distributed with
twitteringmode cannot correctly perform HTTPS POST with nonempty postbody via a proxy. So, you cannot
use it for xAuth via a proxy. (You can use it for OAuth and tweet retrieval.) In addition, `gnutls_cli’ and
‘openssl’ cannot be used with a proxy. – Tadashi MATSUO
‘@’replies from people I follow which are directed to people other than myself don’t show up in my :home
timeline; is there any way to change this? – Alexis
Alias may help you. If you have the below configuration, the timeline $me includes such tweets.
(setq twitteringtimelinespecalias (("me" . "$r(YOURUSERNAME)") ("r" . ,(lambda (username) (format "$relatedto(%s)" username))) ("relatedto" . ,(lambda (username) (if username (format ":search/to:%s OR from:%s OR @%s/" username username username) ":home")))))
To read tweets related to someone, you can use the timeline $r(HISORHERUSERNAME) . – Tadashi
MATSUO
Any way to add support for user switching? I.e. if you have multiple Twitter accounts. TwIt
(http://www.emacswiki.org/emacs/TwIt) had this, but now has been discontinued, with its developer switching to
TwitteringMode (http://www.emacswiki.org/emacs/TwitteringMode)… – JJ
I like the feature in rcirc that allows toggling between unread /msgs and the current coding buffer using `Cc C@’
(`@’ → space). Is there a chance of introducing this feature? – Djui
Mar 23, 2011; I had similar problems, getting the message: “Authorization via OAuth failed. Type Mx twit to
retry.” on GNU Emacs (Windows), twitteringmode1.0.0. I know SSL works because I write/use other Emacs
applications that consume HTTPS content. The following steps fixed the situation for me: 1) Get the updated CA
certificate from Git. 2) Save the certificate to twitteringmode1.0.0/wincurl/equifax.cer 3) In your .emacs, add:
(setq twitteringcurlprogram (concat sitelisppath "/twitteringmode1.0.0/wincurl/curl.exe"))(setq twitteringcertfile (concat sitelisppath "/twitteringmode1.0.0/wincurl/equifax.cer"))
Where sitelisppath expands to your Emacs sitelisp directory. Now when I do Mx twit, I see the successful
connection in Wireshark and get the request for my OAuth Pin. – sboles
10 May 2011: If you’d like to filter incoming tweets so that those matching a particular pattern aren’t displayed in
your timeline, you might find the following code useful:
(setq twitteringtweetfilters '("example" "example phrase")) (defun twitteringfiltertweets () (setq nonmatchingstatuses '()) (dolist (status twitteringnewtweetsstatuses) (setq matchedtweets 0) (dolist (pat twitteringtweetfilters) (if (stringmatch pat (cdr (assoc 'text status))) (setq matchedtweets (+ 1 matchedtweets)))) (if (= 0 matchedtweets) (setq nonmatchingstatuses (append nonmatchingstatuses (,status))))) (setq newstatuses nonmatchingstatuses)) (addhook 'twitteringnewtweetshook 'twitteringfiltertweets)
The above will not display any tweets containing the text “example” or “example phrase”. A filter can consist of
any regex accepted by the ‘stringmatch’ function.
Tested with emacs 23.2.
– Alexis
If need filtering URLs (e.g. adf.ly, 4sq.com) and username, try this: https://github.com/hayamiz/twittering
mode/pull/73#issuecomment27641530 (https://github.com/hayamiz/twitteringmode/pull/73#issuecomment
27641530)
Code is from Alexis’ and cvmat’s:
;;;; Filtering.(defvar twitteringfilterusers '() "*List of strings containing usernames (without '@' prefix) whose tweets should not be displayed in timeline.")(defvar twitteringfiltertweets '() "*List of strings containing phrases which will prevent a tweet containing one of those phrases from being displayed in timeline.")
(defun twitteringfiltersapply () (setq nonmatchingstatuses '()) (dolist (status twitteringnewtweetsstatuses) (setq matchedtweets 0) (dolist (pat twitteringfilterusers) (if (stringmatch pat (cdr (assoc 'userscreenname status))) (setq matchedtweets (+ 1 matchedtweets)))) (dolist (pat twitteringfiltertweets) (if (stringmatch pat (twitteringmakefontifiedtweettextwithentity status)) (setq matchedtweets (+ 1 matchedtweets)))) (if (= 0 matchedtweets) (setq nonmatchingstatuses (append nonmatchingstatuses (,status))))) (setq newstatuses nonmatchingstatuses))(addhook 'twitteringnewtweetshook 'twitteringfiltersapply)
(setq twitteringfiltertweets '("http://4sq.com/.*" "http://adf.ly/.*" "I liked a @YouTube video"))
– kuanyui
Are there commands to view lists of (i) people who you’re following and (ii) people who’re following you? For that
matter, is there any manual?
BeSlayed (http://www.emacswiki.org/emacs/BeSlayed)
How could I expand the number of twitts retrieved on the mode startup? And why we don’t have a command like
`twitteringfavoritetimeline`?
FabioCosta? (http://www.emacswiki.org/emacs?action=edit;id=FabioCosta)
Does the image publishing feature being included in the TODO list? It is a very important function for twittering…
Cesc
After having trouble installing twitteringmode and EasyPG (http://www.emacswiki.org/emacs/EasyPG) on the
mac, I spent some time and managed to track down a copy of alpaca.el (0.13). I have created a repository for it
here (https://github.com/unpluggd/alpaca.el) to make it a little easier to find for anyone wishing to use it in place
of EasyPG (http://www.emacswiki.org/emacs/EasyPG).
unpluggd
Can I use twitter’s lists? I found apimethods in the code, but I don’t understand how to use it.
pimiento
See also: Twitter (http://www.emacswiki.org/emacs/Twitter) Identicamode (http://www.emacswiki.org/emacs/Identica
mode)
日本語 (http://www.emacswiki.org/emacsja/TwitteringModeja)
Add Translation (http://www.emacswiki.org/emacs?action=translate;id=TwitteringMode;missing=de_es_fr_it_ko_pt_ru_se_zh)
Edit this page (http://www.emacswiki.org/emacs?action=edit;id=TwitteringMode)
View other revisions (http://www.emacswiki.org/emacs?action=history;id=TwitteringMode)
Administration (http://www.emacswiki.org/emacs?action=admin;id=TwitteringMode)
Last edited 20131103 11:15 UTC by kuanyui (http://www.emacswiki.org/emacs/kuanyui) (diff) (http://www.emacswiki.org/emacs?action=browse;diff=2;id=TwitteringMode)
This work islicensed toyou underversion 2 ofthe GNU (http://www.gnu.org/) General Public License (/GPL). Alternatively, you maychoose to receive this work under any other license that grants the right to use, copy,modify, and/or distribute the work, as long as that license imposes the restriction thatderivative works have to grant the same rights and impose the same restriction. Forexample, you may choose to receive this work under the GNU (http://www.gnu.org/)Free Documentation License (/FDL), the CreativeCommons(http://creativecommons.org/) ShareAlike(http://creativecommons.org/licenses/sa/1.0/) License, the XEmacs manual license, orsimilar licenses (/OLD).
(http://creativecommons.org/licenses/GPL/2.0/)