Skip to content

Instantly share code, notes, and snippets.

<?php
function tggl_req($user, $path, $method="GET" ,$postFields = array()){
$ch = curl_init('https://www.toggl.com/api/v8/'.$path);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $user . ":api_token");
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
if(count($postFields) > 0){
curl_setopt($ch, CURLOPT_POST, 1);
#!/bin/bash
###################################################################
# A Project of TNET Services, Inc
#
# Title: rpi-wiggle
# Author: Kevin Reed (Dweeber)
# dweeber.dweebs@gmail.com
# Project: Raspberry Pi Stuff
#
# Credits: jojopi on Raspberry Pi Forum who provided sample code