Skip to content

Instantly share code, notes, and snippets.

@RemyPorter
Last active February 26, 2021 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RemyPorter/99b0c45015950415eea3d08303f84311 to your computer and use it in GitHub Desktop.
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`.
# 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