Commit 3d560dba authored by Iván Sánchez Ortega's avatar Iván Sánchez Ortega

More readme; fix screenname replying

parent ab091ca1
......@@ -4,9 +4,12 @@
It's social, and it's CLI. So, soCLIal.
As of now, soCLIal is feature-incomplete. The current list of features is:
- It allows you to sign into a `mastodon.social` account and display your home timeline.
- It allows you to sign into a twitter account and display your home timeline.
- Sign into a `mastodon.social` account, and display your home timeline.
- Sign into a twitter account, and display your home timeline.
- Display statuses, RTs/boosts, and quoted statuses in a compact and legible way
- Post new statuses (text only)
- Reply to statuses
- Echo (retweet/boost/reshare) statuses
The interface is meant to be as close as TTYtter/oysttyer as possible. Interactive
shell, streaming of messages by default, different colours for different kinds
......@@ -16,10 +19,12 @@ of messages.
### Quickstart
There are no releases yet, so
* `git clone` this repo
* Run either `npm install` or `yarn` to fetch dependencies
* If you use NodeJS < v7, run either `npm run-script build` or `yarn build`, then `nodejs dist/soclial.js`
* If you use NodeJS >= v7 (with support for ES2015 and other goodies), run `nodejs src/soclial.js`
* Run either `npm run-script build` or `yarn build`
* Run `nodejs dist/soclial.js`
Once soCLIal is up and running:
* Type `help` for a list of commands
......@@ -29,12 +34,13 @@ Once soCLIal is up and running:
### TODO:
- Use https://www.npmjs.com/package/get-urls and https://www.npmjs.com/package/article-parser to de-shortify all URLs
- Promisify emitting statuses, to deal with the asynchronicity of URL cleaning
- Use @mourner's https://www.npmjs.com/package/tinyqueue to store resolved statuses
and pull the complete ones to the UI.
- Cover edge cases of replying and echoing statuses, improve error handling
- Display threads
- Allow posting and echoing to a subset of the accounts
- Implement channels (replies/notifications/direct messages/search terms/user lists)
- Allow listening/unlistening to channels
- Offer platforms (and plugins?) a better API surface of the currently running
soclial instance (instead of just a reference to Vorpal and a handler)
......
......@@ -107,7 +107,7 @@ class MastodonAccount extends Account {
let replyStatusId = item.raw.id;
let replyStatusScreenName = "@" + item.raw.account.acct;
if (!str.toLowerCase().indexOf( replyStatusScreenName.toLowerCase() )) {
if (str.toLowerCase().indexOf( replyStatusScreenName.toLowerCase() ) === -1) {
/// FIXME!!! This will match partial usernames (e.g. searching for @john
/// will match @johnDoe). Should use some kind of regexp here.
......
......@@ -163,7 +163,7 @@ class TwitterAccount extends Account {
let replyStatusId = item.raw.id_str;
let replyStatusScreenName = "@" + item.raw.user.screen_name;
if (!str.toLowerCase().indexOf( replyStatusScreenName.toLowerCase() )) {
if (!str.toLowerCase().indexOf( replyStatusScreenName.toLowerCase() ) === -1) {
/// FIXME!!! This will match partial usernames (e.g. searching for @john
/// will match @johnDoe). Should use some kind of regexp here.
......@@ -177,6 +177,10 @@ class TwitterAccount extends Account {
}
echoify(item) {
if (item.echoed) {
return "RT @" + item.raw.retweeted_status.user.screen_name + ': ' + item.echoed.str;
}
return "RT @" + item.raw.user.screen_name + ': ' + item.str;
}
......@@ -185,7 +189,7 @@ class TwitterAccount extends Account {
// Native RT
return this._tw.post('statuses/retweet', {
id: item.raw.id_str
}, function(error, tweet, response) {
}, (error, tweet, response)=>{
if(error) {
this._vorpal.log(chalk.red('Could not echo into twitter: ' + error[0].message));
}
......@@ -229,7 +233,6 @@ class TwitterAccount extends Account {
// return striptags( he.decode( str.replace('</p><p>', ' // ') ) );
return str.
replace(/\n/g, ' // ').
replace(/&amp;/g, "&").
replace(/&gt;/g, ">").
replace(/&lt;/g, "<");
......
......@@ -35,6 +35,7 @@ export default function stringify(conf, item) {
quotedStr = '\n ' + stringify(conf, item.quoted);
}
str = str.replace(/\n/g, ' ␤ ');
let formatted =
(sender ? (' <' + chalk.bold(sender) + '>') : '') +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment