diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..a88c976 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: vendor/bin/heroku-php-apache2 diff --git a/README.md b/README.md index a8971dd..5969cf9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ Activity

-[![SensioLabsInsight](http://i.imgur.com/zS1IVWU.png)](https://insight.sensiolabs.com/projects/532e42dd-402e-4605-b8a8-5e5dc8fe6dc2)  [![StyleCI](https://styleci.io/repos/74149532/shield)](https://styleci.io/repos/74149532)  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/9b9322d8623b4ac281679e0b7dbaffa5)](https://www.codacy.com/app/m1guelpiedrafita/Activity?utm_source=github.com&utm_medium=referral&utm_content=m1guelpf/Activity&utm_campaign=Badge_Grade)  [![License](https://img.shields.io/github/license/m1guelpf/Activity.svg)](LICENSE)  [![Issues](https://img.shields.io/github/issues/m1guelpf/Activity.svg)](https://github.com/m1guelpf/Activity/issues) [![Mantained](https://img.shields.io/maintenance/yes/2016.svg)](https://github.com/m1guelpf/Activity) +[![SensioLabsInsight](http://i.imgur.com/zS1IVWU.png)](https://insight.sensiolabs.com/projects/532e42dd-402e-4605-b8a8-5e5dc8fe6dc2) [![StyleCI](https://styleci.io/repos/74149532/shield)](https://styleci.io/repos/74149532) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/9b9322d8623b4ac281679e0b7dbaffa5)](https://www.codacy.com/app/m1guelpiedrafita/Activity?utm_source=github.com&utm_medium=referral&utm_content=m1guelpf/Activity&utm_campaign=Badge_Grade) [![License](https://img.shields.io/github/license/m1guelpf/Activity.svg)](LICENSE) [![Issues](https://img.shields.io/github/issues/m1guelpf/Activity.svg)](https://github.com/m1guelpf/Activity/issues) [![Mantained](https://img.shields.io/maintenance/yes/2016.svg)](https://github.com/m1guelpf/Activity) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/m1guelpf/Activity.svg)](http://isitmaintained.com/project/m1guelpf/Activity "Average time to resolve an issue") + +[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/m1guelpf/Activity/tree/heroku) A PHP API to log anything anywhere @@ -21,7 +23,18 @@ This script is currently over active development and it is currently in a **beta * *(Only if using the NodeJS client): Node request package* ## Download: -You can view the lastest **stable** release [here](https://github.com/m1guelpf/Activity/releases/latest). + +* You can get the lastest **stable** release [here](https://github.com/m1guelpf/Activity/releases/latest). +* You can get the lastest **beta** release [here](https://github.com/m1guelpf/Activity/archive/master.zip). + +## Installation: + +1. Download lastest release (check [the downloads section](#download)). +2. Copy all the files to your server root / a subdirectory. +3. Create a MySQL database and fill the access details in the config.example.php +4. Rename config.example.php to config. +5. Change the example settings in the clients to your settings. +6. Enjoy! ## Examples: You can see examples of use in php, python and bash in [the examples folder](https://github.com/m1guelpf/Activity/blob/master/examples/) @@ -29,6 +42,7 @@ You can see examples of use in php, python and bash in [the examples folder](htt ## TO DO: * [x] Ruby Client * [x] GO Client +* [ ] C# client * [x] Retrieve visit information whit GET requests. * [ ] More clients diff --git a/app.json b/app.json new file mode 100644 index 0000000..dc75225 --- /dev/null +++ b/app.json @@ -0,0 +1,26 @@ +{ + "name": "Activity", + "description": "Log anything anywhere.", + "repository": "https://github.com/m1guelpf/Activity-heroku", + "logo": "https://camo.githubusercontent.com/e97534a44c1aa3bed22f7835c8e99a64180a3e55/687474703a2f2f692e696d6775722e636f6d2f497762574b4a6e2e706e67", + "keywords": ["Activity", "php", "m1guelpf"], + "website": "https://github.com/m1guelpf/Activity", + "env": { + "DB_HOST": { + "description": "Your MySQL DB host", + "required": true + }, + "DB_NAME": { + "description": "Your MySQL DB name", + "required": true + }, + "DB_USER": { + "description": "Your MySQL DB user", + "required": true + }, + "DB_PASS": { + "description": "Your MySQL DB password", + "required": true + } + } +} diff --git a/config.example.php b/config.php similarity index 73% rename from config.example.php rename to config.php index f0715e7..83f37c7 100644 --- a/config.example.php +++ b/config.php @@ -1,10 +1,10 @@ 1, - CURLOPT_URL => $url.'?token='.$token, - CURLOPT_USERAGENT => 'ActivityPost', - CURLOPT_POST => 1, - CURLOPT_POSTFIELDS => [ - 'activityType' => '1', - 'activityTitle' => 'value2', - 'activityIP' => 'value3', - 'activityUserAgent' => 'value4', - ], -]); -// Send the request -// '$resp = ' is keeped for troubleshooting proposes -/*$resp = */curl_exec($curl); -// Close request to clear up some resources -curl_close($curl); diff --git a/examples/example.py b/examples/example.py deleted file mode 100644 index 6db1692..0000000 --- a/examples/example.py +++ /dev/null @@ -1,3 +0,0 @@ -import requests -post_data = {'activityType':'1', 'activityTitle':'Python', 'activityIP':'127.0.0.1', 'activityUserAgent':'Python'} -requests.post(url='http://activity.local.dev?token=test', data=post_data) diff --git a/examples/example.rb b/examples/example.rb deleted file mode 100644 index ec4bd64..0000000 --- a/examples/example.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'net/http' -uri = URI.parse("http://activity.local.dev?token=test") -Net::HTTP.post_form(uri, {"activityType" => "1", "activityTitle" => "Ruby", "activityIP" => "127.0.0.1", "activityUserAgent" => "Ruby"}) diff --git a/examples/example.sh b/examples/example.sh deleted file mode 100644 index 67f1d9b..0000000 --- a/examples/example.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -if [ ! -x /usr/bin/curl ] ; then - command -v wget >/dev/null 2>&1 || { echo >&2 "Please install cURL or set it in your path. Aborting."; exit 1; } -fi -curl -X POST -F 'activityType=1' -F 'activityTitle=Test' -F 'activityIP=127.0.0.1' -F 'activityUserAgent=Test' http://YOUR_URL?token=YOUR_TOKEN