Wordlebyt: Display your daily Wordle Score

I’m part way through developing an app that displays my daily Wordle score. I’m still working out how exactly to get the data from Wordle into the Tidbyt.

Current Display:

Suggestions welcome for getting the data on the display updated daily.
Current thoughts:

  • Share to the Tidbyt app on Android/iPhone
  • Post a JSON/POST message direct to the Tidbyt
  • Scrape the data out of the Browser’s LocalStorage file, nyt-wordle-state key/object
  • ?
3 Likes

Current plan is to Post my score to Twitter, and have the Tidbyt pull score from there. That said, I’m having a bit of a struggle trying to figure out how to get Pixlet to pull my latest tweet, decode, and drop into my current display widgets.

Suggestions? Help? I already have my Twitter Dev account, and a Bearer Token; which was a learning experience all its own!

Ok, quick update. I’ve successfully gotten my code to pull my latest twitter post!

First I pull all my latest tweets:

    res = http.get(
        url = "https://api.twitter.com/2/users/15010281/tweets?start_time=2022-05-05T00:00:00Z",
        headers = {
            "Authorization": "Bearer " + str(BEARER_TOKEN)
        }
    )

Then I take the JSON returned from the Twitter API above, and pull out the latest Tweet’s text only:
print(res.json()["data"][0]["text"])

I have a couple print statements which are helping me debug:

    print(str(res.status_code))
    print(res.json()["data"][0]["text"])

Which gives me:
image

Now I just need to figure out how to map that string (including the color boxes!) to the widgets that I made last week…

2 Likes

SUCCESS! Thanks to an amazing user on Discord, @rgkimball , I’ve got a local working copy. Couldn’t seem to wrap my brain around building the UI via “for loops” but it finally clicked.

Next up, I’m going to try to figure out 2 things:

  1. Hide my App Bearer Token via an environment variable or cache or … ???

  2. Investigate pushing to the Community Apps so everyone can use it!

1 Like