Better formatting of tweet titles
This commit is contained in:
BIN
android/Omnivore/app/release/app-release.aab
Normal file
BIN
android/Omnivore/app/release/app-release.aab
Normal file
Binary file not shown.
@ -134,8 +134,8 @@ const getTweetsByIds = async (ids: string[]): Promise<Tweets> => {
|
||||
return response.data
|
||||
}
|
||||
|
||||
const titleForAuthor = (author: { name: string }) => {
|
||||
return `${author.name} on Twitter`
|
||||
const titleForTweet = (author: { name: string }, text: string) => {
|
||||
return `${author.name} on Twitter: ${text.replace(/http\S+/, '')}`
|
||||
}
|
||||
|
||||
const tweetIdFromStatusUrl = (url: string): string | undefined => {
|
||||
@ -319,7 +319,7 @@ export class TwitterHandler extends ContentHandler {
|
||||
const authorId = tweetData.author_id
|
||||
const author = tweet.includes.users.filter((u) => (u.id = authorId))[0]
|
||||
// escape html entities in title
|
||||
const title = titleForAuthor(author)
|
||||
const title = titleForTweet(author, tweetData.text)
|
||||
const escapedTitle = _.escape(title)
|
||||
const authorImage = author.profile_image_url.replace('_normal', '_400x400')
|
||||
const description = _.escape(tweetData.text)
|
||||
|
||||
Reference in New Issue
Block a user