Commit 074ae4b0 authored by Iván Sánchez Ortega's avatar Iván Sánchez Ortega

Update readme; use extended text for tweets

parent 4bd45054
......@@ -6,6 +6,7 @@ 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.
- Display statuses, RTs/boosts, and quoted statuses in a compact and legible way
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
......@@ -26,6 +27,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.
......
......@@ -76,88 +76,6 @@ class TwitterAccount extends Account {
});
/* A update msg looks like:
{ created_at: 'Thu May 04 10:35:11 +0000 2017',
id: 860080357412098000,
id_str: '860080357412098048',
text: 'Conoce qué proyectos de investigación impulsa el equipo de mediación de Medialab a través de nuestro canal de Vimeo… https://t.co/aPayvclXkb',
truncated: true,
entities:
{ hashtags: [],
symbols: [],
user_mentions: [],
urls: [ [Object] ] },
source: '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
in_reply_to_screen_name: null,
user:
{ id: 17772404,
id_str: '17772404',
name: 'Medialab-Prado',
screen_name: 'medialabprado',
location: 'Pza Letras C/ Alameda15 Madrid',
description: 'Laboratorio ciudadano de producción, investigación y difusión de proyectos culturales. Ayuntamiento de Madrid',
url: 'http://t.co/eLxmLqyrA2',
entities: { url: [Object], description: [Object] },
protected: false,
followers_count: 52672,
friends_count: 4052,
listed_count: 1847,
created_at: 'Mon Dec 01 05:31:19 +0000 2008',
favourites_count: 2879,
utc_offset: 7200,
time_zone: 'Madrid',
geo_enabled: true,
verified: false,
statuses_count: 17031,
lang: 'es',
contributors_enabled: false,
is_translator: false,
is_translation_enabled: false,
profile_background_color: 'ACDED6',
profile_background_image_url: 'http://pbs.twimg.com/profile_background_images/654221605183352833/etylE-He.jpg',
profile_background_image_url_https: 'https://pbs.twimg.com/profile_background_images/654221605183352833/etylE-He.jpg',
profile_background_tile: true,
profile_image_url: 'http://pbs.twimg.com/profile_images/745538951935463424/MsxkJJfq_normal.jpg',
profile_image_url_https: 'https://pbs.twimg.com/profile_images/745538951935463424/MsxkJJfq_normal.jpg',
profile_banner_url: 'https://pbs.twimg.com/profile_banners/17772404/1489160001',
profile_link_color: '1B95E0',
profile_sidebar_border_color: 'FFFFFF',
profile_sidebar_fill_color: 'F6F6F6',
profile_text_color: '333333',
profile_use_background_image: true,
has_extended_profile: false,
default_profile: false,
default_profile_image: false,
following: true,
follow_request_sent: false,
notifications: false,
translator_type: 'none' },
geo: null,
coordinates: null,
place: null,
contributors: null,
is_quote_status: false,
retweet_count: 1,
favorite_count: 0,
favorited: false,
retweeted: false,
possibly_sensitive: false,
possibly_sensitive_appealable: false,
lang: 'es' }
*/
// });
return super.constructor(callback, opts);
}
......@@ -231,7 +149,9 @@ class TwitterAccount extends Account {
// console.log(msg.entities.urls);
if (msg.extended_tweet) {
return this._normalize(msg.extended_tweet);
// return this._normalize(Object.assign({}, msg.extended_tweet, msg);
msg.text = msg.extended_tweet.full_text;
/// TODO: Maybe something has to be done about the entities?
}
if (msg.retweeted_status) {
......@@ -256,6 +176,14 @@ class TwitterAccount extends Account {
let allMedia = (allEntities.media && allEntities.media.map(i=>i.media_url_https || i.media_url )) || [];
// let allMedia = (allEntities.media && allEntities.media.map((i)=>{
// return
// // (i.video_info && i.video_info.variants[0].url) ||
// // i.expanded_url ||
// i.media_url_https ||
// i.media_url
// })) || [];
let str = this._cleanString(msg.text, allEntities);
return({
......
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