Initial commit

master
J.Fernando Sánchez 12 years ago
commit 20a6d7c1cd

@ -0,0 +1,18 @@
![GSI Logo](http://gsi.dit.upm.es/templates/jgsi/images/logo.png)
[Web 4.0](http://gsi.dit.upm.es)
==================================
Description
---------------------
This module is part of the Web4.0 project.
You can use it to query the spotlight endpoint in order to tag text.
Dependencies
--------------------
To run this project, you will need to install the following dependencies through npm:
- coffee-script
- request
- querify
- hook.io

@ -0,0 +1,20 @@
request = require 'request'
querystring = require 'querystring'
cb = console.log
query = "I like indie music"
#console.log " http://spotlight.dbpedia.org/rest/annotate?" + querystring.stringify({confidence:-1,"support":-1,text:query})
opts =
uri: "http://spotlight.dbpedia.org/rest/annotate?" + querystring.stringify({text:query,confidence:0.0,support:-1})
headers: {"Accept": 'application/json'}
encoding: 'utf8'
request.get opts, (err, res, body) ->
if res?.statusCode is 200
# cb? "Response: #{body}"
cb? null, JSON.parse body
else
cb? "Something went wrong"
cb? [err, res, body]

@ -0,0 +1,2 @@
require('coffee-script')
require('./hook.io-spotlight')
Loading…
Cancel
Save