GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - WISDelft/crowdery-crowdflower-java: Part of the Crowdery framework. Java implementation of the Crowdflower API.

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
log
log
 
 
src/nl/wisdelft/cf
src/nl/wisdelft/cf
 
 
test/nl/wisdelft/cf
test/nl/wisdelft/cf
 
 
.gitignore
.gitignore
 
 
.sampleJobDatamodel.swp
.sampleJobDatamodel.swp
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 
pom.xml.releaseBackup
pom.xml.releaseBackup
 
 
sampleJobDatamodel
sampleJobDatamodel
 
 

Repository files navigation

JCrowdFlower

JCrowdflower is a library for crowdflower web interface wrapped up in java.

This project is part of Web information Systems groups.

Contributors

  • Debarshi Basak (main developer)
  • Jasper Oosterman (reviewer)
  • Alessandro Bozzon (project conceptualization)

jCrowdFlower

This projects is a Java wrapper for web APIs exposed by CrowdFlower. This project is located in master branch.

You need to build the project as follows

mvn clean install

Tutorial

Simple job creation

Note

  • Create a file called default.properties.
  • Add a property apiKey="your-api-key"
  • Include this project in your pom.xml as follows
<dependency>
    <groupId>crowdflower-java</groupId>
    <artifactId>crowdflower-java</artifactId>
    <version>1.0.1-SNAPSHOT</version>
<dependency>

Then the following is the implementation for creating a job

import nl.wisdelft.cf.*;
import nl.wisdelft.cf.datamodel.*;
import nl.wisdelft.cf.exception.*;
import nl.wisdelft.cf.job.*;
import nl.wisdelft.cf.order.*;

public class CrowdFlowerTutorial {

    public static void main(String[] args) throws NullAPIKeyException, InterruptedException
    {
        /**
         * Alternatively you can declare it as
         * CrowdFlowerFactory.setProperties("/path/to/properties/file");
         *
         * or
         *
         * CrowdFlowerFactory.setApiKey("api-key");
         */

        JobController myJobController = CrowdFlowerFactory.getJobController();
        Job myJob = new Job();

        /**
         * You must have following three properties to create a job successfully
         */

        myJob.addProperty(JobAttribute.TITLE, "Test Job title");
        myJob.addProperty(JobAttribute.INSTRUCTIONS, "Test instructions");
        myJob.addProperty(JobAttribute.CML, "<cml>Test cml </cml>");
        myJob.addProperty(JobAttribute.PAGES_PER_ASSIGNMENT,
                          "0.1");
        myJob.addProperty(JobAttribute.UNITS_PER_ASSIGNMENT,
                          "1");

        Job myJobAfterCreation = myJobController.create(myJob);

        myJobController.upload(myJobAfterCreation, "log/crowd.csv", "text/csv");

        OrderController myOrderController = CrowdFlowerFactory.getOrderController();

        Order myOrder = new Order(myJobAfterCreation.getId());
        myOrder.setDebitUnitCount("3");
        myOrder.addChannel("amt");

        /*
        * Costs money
        */

        myOrderController.create(myOrder);

        /**
         * Takes some time to create
         */
        myOrderController.cancel(myJobAfterCreation.getId());
    }
}

Crowdflower behaviour

The Crowdflower API is running under version number 2. Error handling is however not yet consistent or clear. Some problems on the Crowdflower side return HTTP error. Other errors return a HTTP 200 with a error attribute in the (JSON) body of the response.

When updating an entity we have seen the following behaviour:

  • Unknown attributes are ignored
  • Read-only atributes are ignored
  • When an error attribute is returned no fields have been updated
  • When a HTTP 200 reponse is returned with no error attribute all attributes are updated.

Organization

Delft University of Technology
[Faculty] Electrical Engineering, Computer Science and Mathematics
[Department] Software and Computing Technology [Group] Web Information Systems
[Contact] [email protected]

tudelft

About

Part of the Crowdery framework. Java implementation of the Crowdflower API.

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

0 stars

Watchers

7 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.