{"id":16571727,"url":"https://github.com/hrbrmstr/nifffty","last_synced_at":"2025-03-21T12:31:00.704Z","repository":{"id":33977808,"uuid":"37723482","full_name":"hrbrmstr/nifffty","owner":"hrbrmstr","description":"Small R package to post events to IFTTT Maker channel/recipes","archived":false,"fork":false,"pushed_at":"2018-09-18T11:46:49.000Z","size":120,"stargazers_count":40,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T01:11:18.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrbrmstr.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-19T13:33:26.000Z","updated_at":"2022-09-13T13:39:02.000Z","dependencies_parsed_at":"2022-07-13T17:10:35.480Z","dependency_job_id":null,"html_url":"https://github.com/hrbrmstr/nifffty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fnifffty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fnifffty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fnifffty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrbrmstr%2Fnifffty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrbrmstr","download_url":"https://codeload.github.com/hrbrmstr/nifffty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244799252,"owners_count":20512217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T21:25:02.557Z","updated_at":"2025-03-21T12:31:00.294Z","avatar_url":"https://github.com/hrbrmstr.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n\u003c!-- [![Build Status](https://travis-ci.org/hrbrmstr/nifffty.svg)](https://travis-ci.org/hrbrmstr/nifffty) \n![Project Status: Concept - Minimal or no implementation has been done yet.](http://www.repostatus.org/badges/0.1.0/concept.svg)](http://www.repostatus.org/#concept)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/nifffty)](http://cran.r-project.org/web/packages/nifffty) \n![downloads](http://cranlogs.r-pkg.org/badges/grand-total/nifffty) --\u003e\n\n![img](nifffty.png)\n\nnifffty is a simple package to post events/data to an IFTTT Maker channel/recipe *and* receive events (via Maker) from IFTTT actions.\n\nInspired by a [blog post by Brian Connelly](http://bconnelly.net/2015/06/connecting-r-to-everything-with-ifttt/).\n\nHere is a [sample public recipe](https://ifttt.com/recipes/300804-post-maker-event-values-to-dropbox-file) for posting the contents of a `maker` request to a file on Dropbox. The example below, which calls `maker(\"rtest\", \"this\", \"is a\", \"test\")` will create a file in a Dropbox folder (in an `IFTTT/Maker/rtest` directory) that has the contents:\n\n    Value 1: this\n    Value 2: is a\n    Value 3: test\n    \n(How the contents is formatted is entirely up to you.)\n\nBrian's example posts an iOS notification, but you can do many, many things with this capability.\n\nFuture enhancements will include the ability to have Shiny use Maker web POST calls as inputs.\n\nThe following functions are implemented:\n\n- `ifttt_api_key`:\tGet or set IFTTT_KEY value\n- `maker`:\tIssue IFTTT maker channel POST event\n- `receiver`:\tListen and react to IFTTT Maker web calls\n\n### Installation\n\n```{r ex, eval=FALSE}\ndevtools::install_github(\"hrbrmstr/nifffty\")\n```\n\n```{r setup, echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}\noptions(width=120)\n```\n\n### Usage\n\n```{r usage}\nlibrary(nifffty)\n\n# current verison\npackageVersion(\"nifffty\")\n\nmaker(\"rtest\", \"this\", \"is a\", \"test\")\n\n```\n\nTo setup a receiver, create a script on a server that can receive requests from the internet (I named the following `listen.R`):\n\n```{r usage2, eval=FALSE}\nlibrary(nifffty)\n\ndo_it \u003c- function(req) {\n  require(jsonlite)\n  print(fromJSON(names(req$POST())))\n  writeLines(names(req$POST()), \"/tmp/bob.txt\")\n}\n\n# you can change the port to match what you put into IFTTT\n\nrcvr \u003c- receiver(port=10999, handler=do_it)\n\nprint(rcvr)\n\nwhile (TRUE) Sys.sleep(24 * 60 * 60)\n```\n\nFor this example, I created an Apple Watch IFFFT \"DO Button\" to send my coordinates \u0026 timestamp when pressed:\n\n![](do_button_r_nifffty.png)\n\nOnce that's setup, just call the script from the command-line:\n\n    bob@server:~$ Rscript listen.R\n    Loading required package: methods\n    Loading required package: Rook\n    Server started on 0.0.0.0:10999\n    [1] nifffty http://0.0.0.0:10999/custom/nifffty\n\n    Call browse() with an index number or name to run an application.\n    Loading required package: jsonlite\n\n    Attaching package: ‘jsonlite’\n\n    The following object is masked from ‘package:utils’:\n\n        View\n        \nWhen it receives an event it will print the following to the console:\n\n    $latitude\n    [1] 43.25931\n\n    $longitude\n    [1] -70.80062\n\n    $timestamp\n    [1] \"June 19, 2015 at 04:45PM\"\n\nand, write the following to `/tmp/bob.txt`\n\n    bob@server:~$ cat /tmp/bob.txt\n    { \"latitude\": 43.2593566552207, \"longitude\": -70.8004647307757, \"timestamp\": \"June 19, 2015 at 04:46PM\" }\n\nThis same setup will work with any IFTTT action, not just \"DO\" buttons.\n\n### Test Results\n\n```{r test}\nlibrary(nifffty)\nlibrary(testthat)\n\ndate()\n\ntest_dir(\"tests/\")\n```\n\n### Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). \nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fnifffty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrbrmstr%2Fnifffty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrbrmstr%2Fnifffty/lists"}