Created
February 14, 2011 18:01
-
-
Save d6rkaiz/826259 to your computer and use it in GitHub Desktop.
lingr api bot post sample.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'uri' | |
require 'digest/sha1' | |
require 'curb' | |
bot_id=BOT_ID | |
bot_secret=BOT_SECRET | |
sayroom=SAYROOM | |
text='post test' | |
verifier=Digest::SHA1.hexdigest(bot_id+bot_secret) | |
sayurl="http://lingr.com/api/room/say?room=#{sayroom}&bot=#{bot_id}&text=#{URI.escape(text)}&bot_verifier=#{verifier}" | |
c = Curl::Easy.new(sayurl) | |
c.perform |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment