Git Product home page Git Product logo

webhooks's Introduction

Build Status Coverage Status

Analyzing your PyBossa project in real-time

This very simple web module shows how you can easily analyze your PyBossa project in real-time.

PyBossa supports webhooks, notifying via an HTTP POST request the task that has been completed by the volunteers or users. The POST sends basically the following data:


{'fired_at':,
 'project_short_name': 'project-slug',
 'project_id': 1,
 'task_id': 1,
 'result_id': 1,
 'event': 'task_completed'} 

The PyBossa server sends all the required information to analyze the results of the contributions of the volunteers for a given task using Enki.

While the main purpose of this project is to do the analysis of the results, you can customize and fork this project to do many more things like:

  • Post to Twitter that your project has completed a task.
  • Upload the results to your DropBox folder by writing the results in a file.
  • etc.

In this specific version, the analysis module only shows how you can easily get the most voted option for an image pattern recognition project.

Installation

To install the project all you need is run the following command (we recommend you to use a virtual environment):

pip install -r requirements.txt

Now, copy the settings.py.template file to: settings.py and fill in the information. Once you are done with this file, you'll be ready to run the server.

NOTE: Be sure to have a PyBossa API-KEY as the analysis will be stored in the PyBossa results table.

NOTE: It requires a PyBossa server >= 1.2.0.

Running the server

Now that you've the required libraries installed, running the server is as simple as this:

python app.py

Configuring background jobs

By default, this project has disabled the creation of queues in your system. If you expect to have lots of contributions in your project, we recommend you to enable them.

To support queues you will need to install in your machine a Redis server. Then, change the flag: enable_background_jobs to True in your settings.py file, and restart the server.

Note: if you are already running a Redis server and queues, you can customize the name of your queue in the settings file. Check out the config variable: queue_name.

Running the background jobs

Now that you have the project running background jobs, you need to process them. This is very simple, in another terminal run the following command:

rqworker mywebhooks

NOTE: If you've changed the name of the queue, please, update the previous command with your new queue name. That's all! Enjoy!!!

LICENSE / Copyright

Copyright (C) 2015 SciFabric LTD.

See COPYING file.

webhooks's People

Contributors

teleyinex avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

payamka

webhooks's Issues

Webhook documentation

Specify in the documentation (being created) that the webhook endpoint should both POST method, for getting the data, as well as, even empty, GET method, becaused it is used in PyBossa to check if it responds here pybossa/forms/validator.py:98

Running Webhooks in real-time

I have been a newbie in using Pybossa and its various associated tools. I was going through the documentation and understood how it is taking in the data in this form.

{'fired_at':,
'project_short_name': 'project-slug',
'project_id': 1,
'task_id': 1,
'result_id': 1,
'event': 'task_completed'}

But, if I want to execute this in real time, what needs to be given as url for the webhook in the project and what are other requirements to execute it with the Pybossa.

Executing the code

I am trying to run the code but it is again and again taking the GET condition and reverting me to the default chart saved in index.html
How can I give it the POST request as per my project id?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.