Skip to content

Commit

Permalink
fix: make twitter payload adhere the spec #198
Browse files Browse the repository at this point in the history
close #428
  • Loading branch information
guanbinrui committed Nov 27, 2019
1 parent a56f915 commit f2109a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/social-network-provider/twitter.com/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ export const twitterEncoding = {
[':||', '%40'],
['+', '-'],
['=', '_'],
['|', '.'],
[/|/g, '.'],
])}`,
payloadDecoder: (text: string) => {
let r = regexMatch(text, /https:\/\/.+\..+\/%20(.+)%40/, 1)
if (isNil(r)) {
let payload = regexMatch(text, /https:\/\/.+\..+\/%20(.+)%40/, 1)
if (isNil(payload)) {
return 'null'
}
r = batchReplace(r, [
payload = batchReplace(payload, [
['-', '+'],
['_', '='],
['.', '|'],
[/\./g, '|'],
])
return `🎼${r}:||`
return `🎼${payload}:||`
},
}

0 comments on commit f2109a9

Please sign in to comment.