Last active
February 26, 2021 16:50
-
-
Save RemyPorter/99b0c45015950415eea3d08303f84311 to your computer and use it in GitHub Desktop.
Quick/Dirty script to sync local .project/.path files with finger.farm. Depends on `requests`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save your Finger.Farm token in ~/.fingerfarm/token | |
# Update your .plan/.project files as you like, then run this | |
# requires `requests` installed, no I'm not bothing with a requriements file | |
import json | |
import requests | |
from pathlib import Path | |
with open(Path.home() / Path(".plan"), "r") as p: | |
plan = p.read() | |
with open(Path.home() / Path(".project"), "r") as pr: | |
project = pr.read() | |
with open(Path.home() / Path(".fingerfarm/token"), "r") as tk: | |
token = tk.read() | |
token = token.strip() | |
req = {'token': token, 'data': plan} | |
print(requests.put("https://finger.farm/api/remyporter/plan", data=req)) | |
req["data"] = project | |
print(requests.put("https://finger.farm/api/remyporter/project", data=req)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment