This is .Net implementation of recently published python Google Wave robot supasmiley. This is a very simple robot that parses the text in a blip. If there is some text that matches standard character combination for emoticon display, it replaces that text with a google wave gadget to display graphical display. In this example, the robot is only looking for character combination <3. If it is found, the range of characters are removed and gadget is inserted. The gadget is a simple flash movie that display beating heart.
void ProcessEmotions(IEvent e)
{
var txtView = e.Blip.Document;
var txt = txtView.Text;
var idx = txt.IndexOf("<3");
if (idx == -1)
{
return;
}
txtView.Delete(new Range(idx, idx+2));
txtView.InsertElement(idx, new Gadget("http://wave.byteblocks.com/emotions-gadget.xml"));
}
Inserting emoticons into google wave
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2024 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use