Photo by Markus Spiske on Unsplash

Automate boring things!

Open source. Simple to install. Easy to extend.

A single framework- Open Source, Extendable, Scalable and Simple

Photo by KOBU Agency on Unsplash

All your needs in one single framework.

1. Connectors

2. Databases

3. Parsers

4. Skills

Making Skill word of a day using Opsdroid




what's the word of the day?

import logging
import random

import aiohttp
import feedparser

from opsdroid.matchers import match_regex, match_crontab
from opsdroid.message import Message

_LOGGER = logging.getLogger(__name__)

async def get_feed():
async with aiohttp.ClientSession() as session:
async with session.get(_OED_WOD_BASE_URL) as resp:
feed = feedparser.parse(await resp.text())
return feed

@match_regex(r'.*word of the day.*')
@match_crontab('30 09 * * 1-5')
async def word_of_the_day(opsdroid, config, message):
if message is None:
message = Message("",
config.get("room", opsdroid.default_connector.default_room),
intro = random.choice([
"Here's today's word of the day",
"Here's the OED word of the day",
"Why not try and use this word today",
"Today's goal, say this word to a stranger"
feed = await get_feed()
word = feed["entries"][0]["title"]
link = feed["entries"][0]["link"]
definition = ".".join(feed["entries"][0]["summary"].split(".")[1:]).strip()
response = "{}\n> *{}*\n> {}\n> {}".format(intro, word, definition, link)
await message.respond(response)


Photo by Kari Shea on Unsplash

Junior @NITP🌍 ❯ Intern @Dataly ❯ Innovations Lead @dscnitp ❯ Projects Head @hackslash-nitp ❯ 🙅OSH Mentor @anitab-org ❯ ASI @alexa-dev-hub ❯ Mentor @OpenMined

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store