webapi-eca/webpages/handlers/templates/forge_event_poller.html
2014-04-06 02:22:39 +02:00

51 lines
No EOL
1.4 KiB
HTML

Event Poller Name: <input id="input_id" type="text" />
<select id="editor_mode">
<option>CoffeeScript</option>
<option>JavaScript</option>
</select> is public: <input type="checkbox" id="is_public" />
<table id="editor_table">
<tr>
<td id="editor_col" valign="top">
<div id="editor">
#
# EmailYak EVENT POLLER
# ---------------------
#
# Requires user params:
# - apikey: The user's EmailYak API key
#
url = 'https://api.emailyak.com/v1/' + params.apikey + '/json/get/new/email/'
exports.newMail = ( pushEvent ) ->
# needlereq allows the user to make calls to API's
# Refer to https://github.com/tomas/needle for more information
#
# Syntax: needle.request method, url, data, [options], callback
#
needlereq 'get', url, null, null, ( err, resp, body ) ->
if err
log 'Error in EmailYak EM newMail: ' + err.message
else
if resp.statusCode is 200
mails = JSON.parse( body ).Emails
pushEvent mail for mail in mails
</div>
<button id="but_submit">save</button>
</td>
<td id="params_col" valign="top">
This event poller requires user-specific properties:
<table id="tableParams">
<tr>
<td><img src="red_cross_small.png"></td>
<td><input type="text" value="apikey" /></td>
</tr>
<tr>
<td><img src="red_cross_small.png"></td>
<td><input type="text" /></td>
</tr>
</table>
</td>
</tr>
</table>