twitter archive escapes html entities in plain text...

This commit is contained in:
Ted Unangst 2019-11-12 19:12:19 -05:00
parent 65af1f4ac3
commit 54a4a85b58
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,7 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"html"
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
@ -102,6 +103,8 @@ func importTwitter(username, source string) {
Whofore: 2, Whofore: 2,
} }
noise := t.Full_text noise := t.Full_text
// unbelievable
noise = html.UnescapeString(noise)
for _, r := range t.Entities.Urls { for _, r := range t.Entities.Urls {
noise = strings.Replace(noise, r.Url, r.Expanded_url, -1) noise = strings.Replace(noise, r.Url, r.Expanded_url, -1)
} }