Skip to content

REST API for parsing entities out of text messages, for stride

Notifications You must be signed in to change notification settings

JarekSed/stride

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Entity parsing service for Stride/Hipchat.

This is a REST API that takes text messages, and parses out and returns emoticons, user mentions, and links.

It is designed with the assumption that most chat messages are relatively small, and uses regexes to do the parsing.
Scaling horizontally should be trivial: instances have no shared state (or state at all), so they can be spun up/down as needed.
I briefly thought about using AppEngine (or similar) to make scaling even simpler, but didn't want to burn too much of my 2 hours on configuration.

Future TODOs (ideally this would most be integrated with existing system):
  - A load balancer would need to handle routing between instances, and implement detection for things like queries of death, DDOS, etc.
  - Monitoring and logging:
    - QPS, Errors, Latency, Detection rate for each entity, Resource Usage, Uptime, Restarts, Binary Age
  - End-to-end Integration tests
  - Deployment configs
  - Load testing
  - A few smaller scale TODOs are scattered in the code


Usage:
  go build github.com/JarekSed/stride/server
  ./server


Example test request and response:
$  curl -X POST 'http://localhost:8000/entities' -d '{"Message": "@bob @john (success) such a cool feature; https://twitter.com/jdorfman/status/430511497475670016"}'
{"emoticons":["success"],"links":[{"url":"https://twitter.com/jdorfman/status/430511497475670016","title":"Justin Dorfman; on Twitter: \"nice @littlebigdetail from @HipChat (shows hex colors when pasted in chat). http://t.co/7cI6Gjy5pq\""}],"mentions":["bob","john"]}


Dependencies:
  - github.com/gorilla/mux: http routing
  - golang.org/x/net/html: html parsing for finding title of pages linked to
  - mvdan.cc/xurls: URL parsing

About

REST API for parsing entities out of text messages, for stride

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages