Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP API layer for Twitter et cetera #2

Closed
keithamoss opened this issue Jun 7, 2018 · 1 comment
Closed

PHP API layer for Twitter et cetera #2

keithamoss opened this issue Jun 7, 2018 · 1 comment

Comments

@keithamoss
Copy link
Owner

keithamoss commented Jun 7, 2018

  • API layer in front of Twitter to handle caching to stop us running into their rate limits
  • scremsong_social_media_cache table to cache the results of appropriate API calls
    • Id
    • Platform (e.g. Twitter, Instagram, ...)
    • Request Type (e.g. GET, POST)
    • Endpoint (e.g. /searches/tweets)
    • Parameters (URL encoded parameter string)
    • Last Requested (Timestamp)
    • Result (BLOB)
    • TTL (Timestamp)
    • In Progress (Boolean)
    • Pruning Strategy (Age, # of Items)
    • Pruning Threshold (Per Above)
  • Constants (define in soft config - updatable without a deploy?)
    • TTL Base
    • TTL Increment
    • TTL Max
  • TTL timestamp will increase using a back-off approach if we receive no new data.
  • When a request comes in we'll check the cache table to see if we can use the cached result. If not, we'll update the table and fire off a request. If a request is already in progress we'll sleep and wait a few times and then fail back to the client.
  • Rate limits will be passed back to the client to handle appropriately (e.g. show a message, use a modal with a web intent)
  • We assume one column = one API call
@keithamoss
Copy link
Owner Author

Don't need any of this stuff now we're using Python + Django + Celery + Tweepy! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant