GithubHelp home page GithubHelp logo

em-shea / vocab Goto Github PK

View Code? Open in Web Editor NEW
82.0 82.0 25.0 673 KB

A serverless Chinese vocabulary building app. Sends daily vocab words at your HSK level with custom, on-demand vocab quizzes and links to example sentences.

Home Page: https://haohaotiantian.com/

Python 80.17% HTML 19.83%

vocab's Introduction

Hi, I'm Emily.

I like serverless, Python, and Chinese language.

Check out my blog, emshea.com, or find me on Twitter, @em__shea.

A few of my favorite personal projects:

  • ๐Ÿผ Haohaotiantian, daily Chinese vocab emails - homepage, repo
  • ๐Ÿง™ Magic: The Gathering card finder - homepage, repo
  • ๐Ÿฑ Neko Atsume: Cat Collector API - homepage, repo

I currently lead Application Integration Go-To-Market at AWS. These are my personal projects here.

vocab's People

Contributors

em-shea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vocab's Issues

receiving words without confirming my email (can't unsubscribe)

Hi Emily,

I was exploring your application code and functionality so I subscribed to a list. I never confirmed my email address and yet I'm receiving daily words.

Also the "Unsubscribe" functionality is not working and is returning a 502, most probably because my user was not found in the DB.

PostTweet and SendDailyEmail Functions are Not Idempotent

The PostTweet and SendDailyEmail functions are asynchronously invoked by EventBridge with the TodaysWordsSetEventRule rule. Currently, these functions first query DynamoDB to make sure no sending activity has been logged, and then log the sending in the database and proceed to actually send the email or tweet. However, if the function runtime crashes (or encounters some error) after updating the table but before sending the email or tweet, the functions will not pass the idempotency check upon retry, and the program ends without sending the remaining emails or tweets. The triggering error may include software, hardware, or network errors that would cause the asynchronously invoked function to retry.

Issue:
The PostTweet and SendDailyEmail functions could not ensure idempotency when runtime crashes occur after updating the idempotency table but before sending the email or tweet. This results in incomplete sending of emails or tweets when the functions are retried.

Suggested fix:
To make the PostTweet function idempotent, we can send the tweet first and then call update_idempotency_table(). Since Twitter prohibits duplicate tweets within a short period of time, duplicate sending should not occur.
For the SendDailyEmail function, we should send all emails before updating the idempotency table. This approach at least ensures that all subscribers receive at least one email even if the function runtime crashes and restarts.

Pinyin normalization

Take existing CSV with pinyin in the format "an4 li4" and convert to โ€ร nlรฌโ€

Add user interface to sub/unsub

Create webpage for users to subscribe and unsubscribe from messaging.

  • Show previews of example words at each level
  • Show the last word that was published for each level
  • Accept level and phone number, create new or delete SNS sub
  • Welcome text to verify successful sub

Optional:

  • Mini placement test
  • Links to other resources

Add level-specific texts

Add SNS topics for each level.
Add filtering by level on the CSV reader in VocabRandomEntry.

Ex:

[
 {
   hsk_level: "1",
   topic_arn: os.environ['hsk1_arn'],
 },
 {
   hsk_level: "2",
   topic_arn: xxxx,
 },
 {
   hsk_level: "3",
   topic_arn: xxxx,
 }
]

for entry in ^^^:
 1. call random selector to pull word of the day (pass the filter)
 2. send word to SNS (entry['topic_arn'])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.