https://github.com/mikeshultz/capitolguy
Proof of concept of an IRC bot that utilizes the Vote Smart API.
https://github.com/mikeshultz/capitolguy
Last synced: 10 months ago
JSON representation
Proof of concept of an IRC bot that utilizes the Vote Smart API.
- Host: GitHub
- URL: https://github.com/mikeshultz/capitolguy
- Owner: mikeshultz
- License: mit
- Created: 2015-05-30T07:04:55.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-31T19:03:46.000Z (about 11 years ago)
- Last Synced: 2025-02-22T22:27:52.367Z (over 1 year ago)
- Language: Python
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# capitolguy
Proof of concept of an IRC bot that utilizes the [Vote Smart API](https://votesmart.org/share/api).
## Getting started
You can always get help by running `python capitolguy.py --help`
usage: capitolguy.py [-h] [--nick N] [--server SERVER] [--port PORT]
[--name NAME]
C [C ...]
Handle requests for querying Vote Smart data.
positional arguments:
C IRC channel(s) to join.
optional arguments:
-h, --help show this help message and exit
--nick N Nickname the bot should use, if available.
--server SERVER IRC server to connect to.
--port PORT IRC server's port to connect to.
--name NAME Bot's "Real Name"
### Configure
Copy config.ini.tpl to config.ini.
cp config.ini.tpl config.ini
Edit the configuration as you see fit.
### Run
Run the IRC daemon.
python capitolguy.py --nick CapitolDude --server irc.freenode.net '#mycoolchannel' '#anotherchannel' &
## Commands
You can run these commands in the IRC channel and the bot will respond(unless they were removed from `config.ini`).
### Base Commands
#### !sayhi
Command that makes the bot announce itself.
!sayhi
Hello, I am The Capitol Guy! I'm a government and elections transparency bot for #votesmart. Do let them know if I'm acting strangely.
#### !repeat
Stupid command to repeat whatever you tell it.
!repeat I'm a little teapot!
I'm a little teapot!
### Vote Smart Specific Commands
#### !bill
Command that provides minimal data on a bill including a link to the page on votesmart.org for more information.
!bill HR 3361
USA FREEDOM Act(HR 3361). More information: https://votesmart.org/bill/18243
(HR 3361). More information: https://votesmart.org/bill/18243
#### !candidatesearch
Command to search for a candidate by last name.
!candidatesearch Rubio
Marco Rubio: https://votesmart.org/candidate/1601
#### !districtbyzip
Command that will provide the districts for a particular 5-digit or 9-digit USPS Zip code.
!districtbyzip 19403-2801
I found 3 districts for 19403-2801: U.S. House District 6; State House District 150; State Senate District 44. More Information: https://votesmart.org/search?q=19403-2801
#### !officialsearch
Command to search for office holders by last name.
!officialsearch Obama
President Barack Obama II: https://votesmart.org/candidate/9490
Senator Erin Oban: https://votesmart.org/candidate/152042
#### !statefact
Command to query the Vote Smart API for a random state fact. It can accept codes(MT) or name(montana), but they *do* need to be spelled properly.
!statefact Maine
Maine's highest point is Mt. Katahdin, 5,268 ft.