Skip to content

Instantly share code, notes, and snippets.

@mvaneijgen mvaneijgen/
Last active Sep 27, 2019

What would you like to do?
# Config Variables
# To get your API access token
# - go to
# - Click create new app
# - Fill out the infromation and click create app
# - On the page you get redirected to scroll down a bit and click 'Create test token'
# - This is the token you need to set down here
token = '123abc'
# To get your project ID run the following command
# # curl -X GET -H "Authorization: Bearer $token"
project_id = '127864854'
# Local/Instance Variables
command: "curl -s GET '{project_id}' -H 'Authorization: Bearer #{token}'"
showDebug: false
refreshFrequency: 1000 * 60 * 5 # refreshs every 5 minutes
render: (_) -> """
<hr />
<div class="todoist-wrapper"></div>
update: (output, domEl) ->
# convert output to JSON
myoutput = JSON.parse output
# grab dom elements
container = $(domEl).find '.todoist-wrapper'
container.append myoutput
@renderList myoutput, container
renderList: (obj, container) ->
listHtml = ''
# switch list type for header
listHtml += "<ul class='todoist-list'>"
# iterate over list items
for item in obj
listHtml += "<li class='todoist-item'><span></span> #{item.content}</li>"
listHtml += "</ul>"
container.append listHtml
style: """
right: 30px
top: 30px
width: 370px
color: #fff
font-family: Roboto
overflow: hidden
height: 2px
border: 0
background-color: #fff
margin: 10px 0
text-align: right
margin-bottom: 0
font-size: 22px
line-height: 1.4
font-weight: 400
list-style: none
padding: 0
margin: 0
margin-bottom: 15px
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block
transfrom: translateY(-1px)
border: 1px solid #fff
height: 7px
width: 7px
margin-bottom: 3px
margin-right: 5px
font-size: .6rem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.