Giter Site home page Giter Site logo

activism-mailbot's Introduction

Activism Mailbot

In light of recent events, I have created this Python script to send emails to a list of 542 elected US officials.

The script sends a unique message to each lawmaker by varying sentence structures and switching out nouns, verbs, adverbs, and adjectives with synonyms. Each email is constructed to roughly follow the template from nomoreracistcops.github.io. Please report bugs to [email protected]!

This script only works for gmail accounts.

NOTE: there is a per-minute limit on SMTP messages sent via google's servers. to appease our corporate overlords, i've decreased the speed of our operations.

If you're going to use this tool in one of your projects, I'm hoping that you'll have enough self-respect to give credit where it is due. Please do not monetize this script. Thanks!!

Setup

  1. Download the source code

    • Option 1: click the green "Clone or download" button on the upper-right, then "Download ZIP"
      • Then, decompress the files somewhere on your computer
    • Option 2: git clone https://github.com/alandgton/activism-mail-bot.git
      • Requires: a Github account, a terminal, and git installation
  2. Temporarily grant mailbot permission to send emails on your behalf

    • Turn Allow less secure apps to ON for your gmail account.
      • Be aware that this makes it easier for others to gain access to your account.
      • After running the script, you should switch this back OFF.
      • Your name, gmail, and password aren't being stored on a server anywhere, this script is run from your own computer!
    • If you have 2 Factor Authentication enabled on your gmail account:

Running the script

  • Option 1: Use Docker (RECOMMENDED)

    • Shoutout to darrylbalderas for setting this up!

    • Install docker-engine

    • Run the command: ./exec-docker

      • Make sure you're in the activism-mailbot/ or activism-mailbot-master/ directory
        • Use cd activism-mailbot/ or cd ~/activism-mailbot/ or cd /path/to/activism-mailbot/
      • If that doesn't work, then execute the following sequence of commands:
        • docker build -t activism-mailbot .
        • Might need to remove the old container: docker rm -f activism-mailbot
        • docker run --name activism-mailbot -d activism-mailbot
        • docker exec -it $(docker ps -aqf "name=activism-mailbot") /bin/bash
    • Run application: python send.py

  • Option 2: Legacy Method

    • Install python3

    • Mac Users: you can double-click the install-osx-python3 file instead

    • Windows Users: TBD

    • Mac Users: you may need to install certificates for SSL to work

      • ⌘ + space, search for a file named "Install Certificates.command"
      • double-click the resulting file
      • Read more here
    • Run python3 send.py

      • Make sure you are in the activism-mail-bot directory
      • If you aren't, use the command cd activism-mail-bot/

How to use mailbot

  1. Choose which officials you would like to send emails to

    • Enter the number corresponding to the state/city/county of your choice
      • Enter 0 to Select All (current total: 542 recipients)
    • Enter blank (nothing) when finished selecting
    • NOTE: some city councilmembers may ask for your address to confirm that you are their constituent
  2. Enter the subject (title) of your emails.

    • If blank, mailbot will randomly generate a spicy title for you
  3. Would you like to write your own email or have mailbot do it for you?

    • If you want mailbot to write the emails, answer y.
    • Else if you have your own email message, answer n.
      • Mailbot will now read from a .txt file
      • Please write your own email in a .txt file
        • Easiest way: edit the contents of example.txt
        • Tell mailbot the name of your .txt file
        • Example: example.txt
  4. Enter your full name

  5. Enter your gmail

  6. Enter your gmail password

    • i'm not logging this anywhere or anything, feel free to look at my code if you're paranoid

Final Steps

  • Please add more recipients!
  • thank you for your time, we did some good work :^)
  • activism++
  • Please remember to switch Allow less secure apps to OFF.

Footnote

This is a critical time for the rights and freedoms that we cherish as American citizens. Check out this compilation of activism resources and notes (credit: Jemma Kwak)!

Listed below are organizations gladly accepting donations and petitions to sign.

activism-mailbot's People

Contributors

alandgton avatar bmariscal avatar darrylbalderas avatar elansparsons avatar mwaldrich avatar nataliamush avatar nkhalsa avatar rheasrivats avatar samlinville avatar walidalbaki 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

Watchers

 avatar  avatar  avatar  avatar  avatar

activism-mailbot's Issues

bouncebacks I got

Thanks so much for this. Just reporting back on how things went for me:

Message blocked

Your message to [email protected] has been blocked. See technical details below for more information.

Richard N. Gottfried [email protected] auto-reply includes this info: **If your e-mail did not include your postal address, please re-send it with that information.
**If the issue that you wrote about is a federal matter, I urge you to contact your U.S. Representative and our U.S. Senators.
(so maybe some location fill-in is useful? especially because a few of the emails that were sent said "as a concerned constituent" for places I am not a constituent of)

Your message to [email protected] couldn't be delivered.

A custom mail flow rule created by an admin at minneapolismngov.onmicrosoft.com has blocked your message.

feat: Website version for easier access and reach

Could we rebuild this as a webpage? I imagine we could get a lot of reach and use from people who are unfamiliar with the command line.

It doesn't seem insane to port this over to a js script , and have users wait and let the script run clientside. We could host it as a Github page, maybe even use GAuth instead of turning on less-secure apps.

Happy to help build the front end, would need help to port the python to js script though.

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.