Aggregates microblog entries from Twitter and prepares them for being posted to Fidonet.
npm install twi2fido
This application (twi2fido) aggregates microblog entries from Twitter and then prepares them for being posted to Fidonet. (Its name is derived from loosely abbreviated words “tweet to Fido”. It does not imply any endorsement, sponsorship, or association with Twitter.)
This application is written in JavaScript and requires Node.js to run.
* Starting from v2.0.0, this module requires Node.js version 4.0.0 (or newer) because it is rewritten in ECMAScript 2015 (ES6). Previous versions of Node.js (v0.10.x, v0.12.x) are themselves not maintained by their developers after 2016-12-31.
Starting from v2.5.4, this application understands the “extended” version of tweets that has been introduced in the announcements “Coming soon: express even more in 140 characters” and “Doing more with 140 characters” in 2016. The same changes in the source code are apparently enough to also support the doubled limit (280 characters) that has been introduced in the announcement “Giving you more characters to express yourself” in 2017.
npm install -g twi2fido
npm install -g https://github.com/Mithgol/node-twi2fido/tarball/master
PATH. Then use twi2fido command to run the application.
npm install --production in that directory.
npm -g), the application does not appear in the PATH, and thus you'll have to run it directly from the application's directory. You'll also have to run node twi2fido [parameters] instead of twi2fido [parameters].
twi2fido before you run it. (For example, you cannot use npx to run npx twi2fido without having to install twi2fido permanently.) You can configure twi2fido in three simple steps:
example.config to twi2fido.config. Edit twi2fido.config: instead of XXXXX... placeholders you should paste the values of ConsumerKey, ConsumerSecret, AccessTokenKey, AccessTokenSecret that were assigned by Twitter to your application and token.
twi2fido loginName textOutput fileLastRead
loginName — the login name (aka screen name) of a microblog in Twitter. That's the name that usually appears after the @ character in Twitter (or after https://twitter.com/ in URLs). For example, type twi2fido interfax_news to get tweets from @interfax_news.
textOutput — (optional)* path to an output text file. That is the file where the recent tweets should be written to.
textOutput is not given, then the path loginName.tweets.txt is used (for the given value of loginName).
twi2fido resides.
fileLastRead — (optional)* path to a file where the ID of the last read tweet is stored.
fileLastRead is not given, then the path loginName.lastread.txt is used (for the given value of loginName).
twi2fido resides.
fileLastRead) does not exist, then twi2fido cannot determine how many last tweets to post. The default maximum of 100 last tweets is used.
"--CHRS=CP866 2" is accepted before or after any of the above parameters. If such parameter is present, twi2fido writes tweets in the given encoding instead of the default UTF-8 encoding.
CP866 2 such parameter can designate any of Level 2 (single-byte) encodings supported by the FTS-5003.001 standard in Fidonet.
iconv-lite module. (Don't worry, most of them are supported.)
CHRS kludge is added to the output message exactly as the FTS-5003.001 standard dictates.
--norunes is accepted before or after any of the above parameters. It prevents Fidonet runes from being generated to represent attachments (images, videos, “animated GIFs”; see below).
"--hashtag=..." is accepted before or after any of the above parameters. If such parameter is present, twi2fido writes only the tweets that contain at least one of the given hashtags. Several hashtags (separated by commas) may be given. (Example: --hashtag=anime,manga,vn.) The character # is optional before hashtags (it'll be added automatically if omitted in the command line).
--count is accepted before or after any of the above parameters. If such parameter is present, twi2fido does not write tweets to disk (and does not update fileLastRead) and instead reports the number of tweets it would write if called without --count. (It takes "--hashtag=..." into account if it is present.) It is useful for checking if the post would contain enough tweets (or too many tweets), for example.
--debug is accepted before or after any of the above parameters. If such parameter is present, twi2fido does not write tweets to disk (and neither reads nor updates fileLastRead) and instead writes raw JSON from Twitter (of the desinated loginName) to the file debug.json in the directory where twi2fido resides. (It also ignores --count even if it is present.) See debug.bat as an example of such debug on Windows.
fileLastRead), these tweets become posted to textOutput. The default maximum (100 tweets) is enforced: only the latest 100 tweets are posted if more than 100 tweets appeared after the tweet that was read last time.
fileLastRead) does not exist, then twi2fido cannot determine how many last tweets to post. The default maximum is used: 100 last tweets are posted to textOutput.
textOutput file is erased.
textOutput tries to follow Twitter's display requirements satisfying as many rules as possible for the plain text medium of Fidonet which is devoid of client-side JavaScript or Flash.
@ before it), then the date and time,
t.co URLs are conveted back to long original URLs (unless they were longer than 78 characters),
t.co URL), separated by single empty lines. Each picture is represented by a Fidonet rune of a hyperlink:
t.co URL of the picture), separated by an empty line.
t.co URL), separated by an empty line.
twi2fido has to shorten video URLs. It currently uses is.gd API for shortening.
--norunes is given to twi2fido.
CHRS kludge specifying the encoding charset (see above), given by the "--CHRS=..." parameter (or UTF-8 charset by default). Adheres to the FTS-5003.001 standard.
AVATAR kludge containing the URL of the avatar of the given Twitter's user. Adheres to the Fidonet avatars draft standard.
SOURCESITE: Twitter kludge (i.e. the kludge SOURCESITE with the value Twitter). There is no corresponding standard, but such a mark might help to prevent reposts (back to Twitter) by applications that post messages to the opposite direction (from Fidonet to Twitter).
textOutput is ready for posting to Fidonet.
twi2fido does not perform such posting. A multitude of posting tools already exists in Fidonet and the user is free to pick one preferred tool.
if exist textOutput hpt post -nf "twi2fido" -s "Tweets" -e "Example.Echotag" -z "twi2fido" -f loc textOutput
textOutput with the real full path of the output file.)
npm install jshint -g) or locally (npm install jshint in the directory of twi2fido).
npm test (in the directory of twi2fido). Only the JS code errors are caught; the code's behaviour is not tested.
fido2twi posts Fidonet messages to Twitter. It's a useful counterpart to twi2fido.
LICENSE file).