Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 803 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 803 Bytes

Message meta parser

Build Status

Parsing message and find meta information like hashtags or links.

Usage

To use the library just add:

message-meta = "^0.2"

to your dependencies.

extern crate message_meta;

fn main() {
  let meta = message_meta::parse("test message https://google.com/ #hashtag test");
     
  assert_eq!(meta.message, "test message https://google.com/ #hashtag test");
  assert_eq!(meta.links.len(), 1);
  assert_eq!(meta.links[0].url, "https://google.com/");
  assert_eq!(meta.hashtags.len(), 1);
  assert_eq!(meta.hashtags[0].name, "#hashtag1");
}