-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom explorer view for imported tweets
- Loading branch information
Showing
3 changed files
with
232 additions
and
1 deletion.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
datasources/twitter-import/explorer/twitter-import-explorer.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
See https://github.com/digitalmethodsinitiative/4cat/wiki/Exploring-and-annotating-datasets for information on how to add custom CSS. | ||
*/ | ||
|
||
body { | ||
background-color: white; | ||
} | ||
|
||
.posts .post { | ||
position: relative; | ||
background-color: white; | ||
max-width: 620px; | ||
border: 1px solid #d6d6d6; | ||
border-radius: 10px; | ||
min-height: 50px; | ||
} | ||
|
||
.posts .post header { | ||
display: inline-block; | ||
line-height: 1.7em; | ||
margin-bottom: 5px; | ||
border: none; | ||
color: rgb(104, 119, 130); | ||
} | ||
|
||
.posts .post header .post_id { | ||
display: none; | ||
} | ||
|
||
.posts .post header .author { | ||
color: black; | ||
} | ||
|
||
.posts .post header .author_picture { | ||
float: left; | ||
margin-right: 15px; | ||
} | ||
|
||
.posts .post header .author_picture img { | ||
border-radius: 100px; | ||
width: 50px; | ||
} | ||
|
||
.posts .post header .author_picture:after { | ||
display: none; | ||
} | ||
|
||
.posts .post article { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.posts .post.op { | ||
background-color: white; | ||
color: black; | ||
} | ||
|
||
.posts .post .post-content { | ||
display: inline-block; | ||
} | ||
|
||
.posts .post .post-image { | ||
margin-bottom: 10px; | ||
} | ||
|
||
.posts .post .post-image img { | ||
border-radius: 10px; | ||
} | ||
|
||
.posts .external-url { | ||
color: rgb(104, 119, 130); | ||
} | ||
|
||
.posts .post.op .post-annotations, .posts .post .post-annotations { | ||
border-radius: 10px; | ||
background-color: rgb(241, 249, 255); | ||
color: #474747; | ||
} | ||
|
||
span.hashtag { | ||
color: rgb(29, 155, 240); | ||
} |
140 changes: 140 additions & 0 deletions
140
datasources/twitter-import/explorer/twitter-import-explorer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"ndjson": { | ||
"id": "{{ rest_id }}", | ||
"author_picture": "<img src='{{ core.user_results.result.legacy.profile_image_url_https }}'>", | ||
"author": "{{ core.user_results.result.legacy.name }}", | ||
"created": "{{ core.user_results.result.legacy.created_at }}", | ||
"body": "{{ legacy.full_text }}", | ||
"likes": "{{ legacy.favorite_count }} <i class='fas fa-heart'></i>", | ||
"retweets": "{{ legacy.retweet_count }} <i class='fas fa-retweet'></i>", | ||
"replies": "{{ legacy.reply_count }} <i class='fas fa-reply'></i>", | ||
"external_url": "https://twitter.com/{{ core.user_results.result.rest_id }}/status/{{ rest_id }}", | ||
"image": "{{ legacy.extended_entities.media.media_url_https }}", | ||
"sort_options": [ | ||
{ | ||
"key": "core.user_results.result.legacy.created_at", | ||
"label": "Old to new" | ||
}, | ||
{ | ||
"key": "core.user_results.result.legacy.created_at", | ||
"label": "New to old", | ||
"descending": true | ||
}, | ||
{ | ||
"key": "rest_id", | ||
"label": "Post id", | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "core.legacy.favorite_count", | ||
"label": "Most likes", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "core.legacy.retweet_count", | ||
"label": "Most retweets", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "core.legacy.reply_count", | ||
"label": "Most replies", | ||
"descending": true, | ||
"force_int": true | ||
} | ||
] | ||
}, | ||
"csv": { | ||
"author_picture": "<img src='{{ profile_image_url }}'>", | ||
"author": "{{ author }}", | ||
"likes": "{{ like_count }} <i class='fas fa-heart'></i>", | ||
"retweets": "{{ retweet_count }} <i class='fas fa-retweet'></i>", | ||
"replies": "{{ reply_count }} <i class='fas fa-reply'></i>", | ||
"external_url": "https://twitter.com/{{ author }}/status/{{ id }}", | ||
"images": "{{ images }}", | ||
"body": "{{ body }}", | ||
"sort_options": [ | ||
{ | ||
"key": "unix_timestamp", | ||
"label": "Old to new", | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "unix_timestamp", | ||
"label": "New to old", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "id", | ||
"label": "Post id", | ||
"force_int": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "like_count", | ||
"label": "Most likes", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "retweet_count", | ||
"label": "Most retweets", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "reply_count", | ||
"label": "Most replies", | ||
"descending": true, | ||
"force_int": true | ||
} | ||
] | ||
}, | ||
"ndjson_old_api": { | ||
"author_picture": "<img src='{{ author_user.profile_image_url }}'>", | ||
"author": "{{ author_user.name }}", | ||
"created": "{{ created_at }}", | ||
"likes": "{{ public_metrics.like_count }} <i class='fas fa-heart'></i>", | ||
"retweets": "{{ public_metrics.retweet_count }} <i class='fas fa-retweet'></i>", | ||
"replies": "{{ public_metrics.reply_count }} <i class='fas fa-reply'></i>", | ||
"external_url": "https://twitter.com/{{ author_user.username }}/status/{{ id }}", | ||
"image": "{{ attachments.media_keys.url }}", | ||
"body": "{{ text }}", | ||
"sort_options": [ | ||
{ | ||
"key": "created_at", | ||
"label": "Old to new" | ||
}, | ||
{ | ||
"key": "created_at", | ||
"label": "New to old", | ||
"descending": true | ||
}, | ||
{ | ||
"key": "id", | ||
"label": "Post id", | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "public_metrics.like_count", | ||
"label": "Most likes", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "public_metrics.retweet_count", | ||
"label": "Most retweets", | ||
"descending": true, | ||
"force_int": true | ||
}, | ||
{ | ||
"key": "public_metrics.reply_count", | ||
"label": "Most replies", | ||
"descending": true, | ||
"force_int": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters