Feedback
External APIs

Giphy: Gif Chat

Add a gif to a chat message based on text in the message
Back to BLOCKS

About Giphy: Gif Chat

Chat is more social with gifs. This block lets users send each others gifs in a chat message based on the text it reads in the message with the Giphy API, just like Slack.

Try it Now
Categories:
External APIs External APIs
Bots & AI
Bots & AI
Chat & Social
Chat & Social
Last Updated:
20160831 at 21:35:43
Author:
Devendra

Walkthrough

This block adds a gif url to a message based on the text. It uses 3rd party Giphy API to get gif url matching input text. Keywords are extracted from text based on usage of /gif tag in message text. The /gif tag is removed from text before publishing.

To learn more about Giphy API and getting your production keys, visit https://api.giphy.com.

Input

Input Channel: pubnub-gif-chat (configurable) A JSON object containing key "text", with the message needs to be published on input channel. If message contains /gif tag, then the next word will be used for finding a matching gif image. Multiple tags can exist in same message. For including gif urls based on phrases or sentences, enclose them using ( ) .
{
    "text" : "/gif hello"
}

Output

Output channel: pubnub-gif-chat (configurable) The modified message containing the list of gif urls is received on same channel.
{
    "text": "hello",
    "gifs": ["http://media1.giphy.com/media/xTiTngMMCIt7FramOc/200.gif"]
}

Try PubNub Today

Connect up to 100 devices for Free