Skip to content

Instantly share code, notes, and snippets.

@d6rkaiz
Created February 14, 2011 18:01
Show Gist options
  • Save d6rkaiz/826259 to your computer and use it in GitHub Desktop.
Save d6rkaiz/826259 to your computer and use it in GitHub Desktop.
lingr api bot post sample.
#-*- 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