alfred-workflows icon indicating copy to clipboard operation
alfred-workflows copied to clipboard

Tweet archive search fails with JSON Parse error

Open andypiper opened this issue 2 years ago • 1 comments

Attempting to run the Tweet archive workflow against my own data results in this error (in the Debug log for Alfred Workflows)

JSON Parse error: Unexpected identifier "window" (-2700)

(nitpick: the install instructions and the help text in the Workflow both reference a data/tweet.js file, the file is actually data/tweets.js)

Checking the file:

$ head data/tweets.js
window.YTD.tweets.part0 = [
  {
    "tweet" : {
      "edit_info" : {
        "initial" : {
          "editTweetIds" : [
            "1593387213315784704"
          ],
          "editableUntil" : "2022-11-18T00:04:50.000Z",
          "editsRemaining" : "5",

So, there is indeed a window object here. My Tweet data is divided across files tweets.js, tweets-part1.js and tweets-part2.js (now I wish I hadn't been quite so prolific...)

Unsure if this issue is only emerging because of my large archive, or whether the format has changed.

andypiper avatar Jan 31 '23 19:01 andypiper

It's possible the format has changed Andy, I haven't checked on this in a while. I did write up a post about a few other options for making a searchable archive here: https://rknight.me/twitter-backup-and-archiving-options/

rknightuk avatar Feb 01 '23 08:02 rknightuk

It turns out I am an idiot and had a typo in the workflow. Apologies this took a year Andy (and you probably don't even need it now) but it is fixed if you redownload the workflow https://github.com/rknightuk/alfred-workflows/tree/main/workflows/twitter-archive-search

rknightuk avatar Feb 27 '24 20:02 rknightuk