# HG changeset patch # User Mikael Berthe # Date 1492301558 -7200 # Node ID 96a7f2432d27176c8780b0c8e3694482d1bf2566 # Parent 330c4b83f7d34a429ef4fdba1d155dbfa9e3177d GetTimelines: Allow '#' as hashtag prefix diff -r 330c4b83f7d3 -r 96a7f2432d27 timelines.go --- a/timelines.go Sat Apr 15 21:08:34 2017 +0200 +++ b/timelines.go Sun Apr 16 02:12:38 2017 +0200 @@ -8,7 +8,7 @@ ) // GetTimelines returns a timeline (a list of statuses -// timeline can be "home", "public", or a hashtag (use ":hashtag") +// timeline can be "home", "public", or a hashtag (use ":hashtag" or "#hashtag") // For the public timelines, you can set 'local' to true to get only the // local instance. func (g *Client) GetTimelines(timeline string, local bool) ([]Status, error) { @@ -17,7 +17,7 @@ switch { case timeline == "home", timeline == "public": endPoint = "timelines/" + timeline - case strings.HasPrefix(timeline, ":"): + case strings.HasPrefix(timeline, ":"), strings.HasPrefix(timeline, "#"): hashtag := timeline[1:] if hashtag == "" { return nil, fmt.Errorf("timelines API: empty hashtag")