timelines.go
changeset 94 beee0238a82e
parent 92 05c201b548b0
child 98 5d803adfc57e
equal deleted inserted replaced
93:d427d8aa75f9 94:beee0238a82e
    15 	var tl []Status
    15 	var tl []Status
    16 
    16 
    17 	if timeline == "home" || timeline == "public" {
    17 	if timeline == "home" || timeline == "public" {
    18 		endPoint = "timelines/" + timeline
    18 		endPoint = "timelines/" + timeline
    19 	} else if strings.HasPrefix(timeline, ":") {
    19 	} else if strings.HasPrefix(timeline, ":") {
    20 		endPoint = "timelines/tag/" + timeline
    20 		hashtag := timeline[1:]
       
    21 		if hashtag == "" {
       
    22 			return tl, fmt.Errorf("timelines API: empty hashtag")
       
    23 		}
       
    24 		endPoint = "timelines/tag/" + hashtag
    21 	} else {
    25 	} else {
    22 		return tl, fmt.Errorf("GetTimelines: bad timelines argument")
    26 		return tl, fmt.Errorf("GetTimelines: bad timelines argument")
    23 	}
    27 	}
    24 
    28 
    25 	req := g.prepareRequest(endPoint)
    29 	req := g.prepareRequest(endPoint)