Skip to content

marcdel/sentient_social

Repository files navigation

Sentient Social

Build, Test, Deploy

Pre-commit steps

  • mix credo && mix dialyzer && MIX_ENV=test mix coveralls.html

Heroku Setup

  • heroku apps:create sentient-social-staging --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"
  • heroku buildpacks:add https://github.com/gjaldon/heroku-buildpack-phoenix-static.git
  • heroku addons:create heroku-postgresql:hobby-dev
  • heroku config:set POOL_SIZE=18
  • heroku config:set SECRET_KEY_BASE="$(mix phx.gen.secret)"

Gigalixir Setup

  • gigalixir set_config sentient-social-stg TWITTER_CONSUMER_SECRET supersecret
  • ...etc.

Twitter Integration Env Vars

TWITTER_CONSUMER_KEY=

TWITTER_CONSUMER_SECRET=

CLOAK_KEY=

Key generation

  • :crypto.strong_rand_bytes(32) |> Base.encode64()

Find latest interactions to be undone

  • SentientSocial.Twitter.AutomatedInteraction |> Ecto.Query.where([ai], not is_nil(ai.undo_at)) |> Ecto.Query.order_by(asc: :undo_at) |> SentientSocial.Repo.all() |> Enum.map(fn ai -> ai.undo_at end)

PCF

  • cf login
  • cf ssh sentient-social
  • /tmp/lifecycle/shell
  • mix run -e 'SentientSocial.Repo.query("select * from users", []) |> IO.inspect()'
  • mix run -e 'SentientSocial.Repo.query("TRUNCATE users cascade", [])'
  • mix run -e 'SentientSocial.Repo.query("TRUNCATE automated_interactions", [])'

Find a random sample of automated interactions

  • marcdel = SentientSocial.Accounts.get_user_by_username("marcdel")
  • SentientSocial.Twitter.list_automated_interactions(marcdel) |> Enum.filter(fn ai -> ai.undo_at != nil end) |> Enum.sort_by(&(&1.undo_at)) |> Enum.map(fn ai -> {ai.undo_at, ai.tweet_id} end) |> Enum.take_random(20)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published