API details.

fastwebhook server

clean_tweet_body[source]

clean_tweet_body(body)

Cleans links and sets proper @'s in the tweet body

tweet_text[source]

tweet_text(payload)

Send a tweet announcing release based on payload

check_sig[source]

check_sig(content, headers, secret)

reconfig[source]

reconfig(s)

run_server[source]

run_server(hostname:str='localhost', port:int=8000, debug:bool_arg=False, inifile:str='twitter.ini', check_ip:bool_arg=True, single_request:bool_arg=False)

Run a GitHub webhook server that tweets about new releases

Type Default Details
hostname str localhost Host name or IP
port int 8000 Port to listen on
debug bool_arg False If True, do not trigger actions, just print
inifile str twitter.ini Path to settings ini file
check_ip bool_arg True Check source IP against GitHub list
single_request bool_arg False Handle one request
time.sleep(0.5) # wait for previous server to stop
threaded(partial(run_server, check_ip=False, debug=True, single_request=True))();
Listening on ('localhost', 8000)
time.sleep(0.5)
urlread("http://localhost:8000", spam=1)
Accept-Encoding: identity
Content-Type: application/x-www-form-urlencoded
Content-Length: 6
Host: localhost:8000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
Connection: close

 b'spam=1'
b''

Installer

fastwebhook_install_service[source]

fastwebhook_install_service(hostname:str='0.0.0.0', port:int=8000, inifile:str='twitter.ini', check_ip:bool_arg=True, service_path:str='/etc/systemd/system/')

Install fastwebhook as a service

Type Default Details
hostname str 0.0.0.0 Host name or IP
port int 8000 Port to listen on
inifile str twitter.ini Path to settings ini file
check_ip bool_arg True Check source IP against GitHub list
service_path str /etc/systemd/system/ Directory to write service file to

This fastcore.script CLI installs fastwebhook as a systemd service. Run fastwebhook_install_service --help in your terminal for options.