Skip to content

Instantly share code, notes, and snippets.

@fabriziogiordano
Created November 2, 2012 06:15

Revisions

  1. fabriziogiordano created this gist Nov 2, 2012.
    26 changes: 26 additions & 0 deletions linkedlistnyc.webscript.io.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    local response = http.request {
    url = 'http://www.linkedlistnyc.org'
    }

    s = response.content

    lk = string.match(s, "<title>(.*)</title>")

    local twilio = require('webscriptio/lib/twilio.lua')

    local ACCOUNTSID = '<YOUR TWILIO ACCOUNT SID>'
    local AUTHTOKEN = '<YOUR TWILIO AUTH TOKEN>'

    local response = twilio.sms(
    ACCOUNTSID,
    AUTHTOKEN,
    '<YOUR TWILIO NUMBER>',
    request.form.phonenumber,
    lk
    )

    if response.statuscode == 201 then
    return 'Text message sent. '..lk..'\n'
    else
    return 'An error occurred. Check the phone number you used.'
    end