-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathredditor.go
70 lines (62 loc) · 2.28 KB
/
redditor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2012 Jimmy Zelinskie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package geddit
import (
"fmt"
)
type Redditor struct {
ID string `json:"id"`
Name string `json:"name"`
Created float64 `json:"created_utc"`
Employee bool `json:"is_employee"`
Gold bool `json:"is_gold"`
IconImageURL string `json:"icon_img"`
Mod bool `json:"is_mod"`
Mail bool `json:"has_mail"`
ModMail bool `json:"has_mod_mail"`
Verified bool `json:"verified"`
VerifiedEmail bool `json:"has_verified_email"`
Karma
}
type Preferences struct {
Research bool `json:"research"`
ShowStylesheets bool `json:"show_stylesheets"`
ShowLinkFlair bool `json:"show_link_flair"`
ShowTrending bool `json:"show_trending"`
PrivateFeeds bool `json:"private_feeds"`
IgnoreSuggestedSort bool `json:"ignore_suggested_sort"`
Media string `json:"media"`
ClickGadget bool `json:"clickgadget"`
LabelNSFW bool `json:"label_nsfw"`
Over18 bool `json:"over_18"`
EmailMessages bool `json:"email_messages"`
HighlightControversial bool `json:"highlight_controversial"`
ForceHTTPS bool `json:"force_https"`
Language string `json:"lang"`
HideFromRobots bool `json:"hide_from_robots"`
PublicVotes bool `json:"public_votes"`
ShowFlair bool `json:"show_flair"`
HideAds bool `json:"hide_ads"`
Beta bool `json:"beta"`
NewWindow bool `json:"newwindow"`
LegacySearch bool `json:"legacy_search"`
}
type Friend struct {
Date float32 `json:"date"`
Name string `json:"name"`
ID string `json:"id"`
}
type Karma struct {
CommentKarma int `json:"comment_karma"`
LinkKarma int `json:"link_karma"`
}
type Trophy struct {
Name string `json:"name"`
Description string `json:"description"`
Icon string `json:"icon_70"`
}
// String returns the string representation of a reddit user.
func (r *Redditor) String() string {
return fmt.Sprintf("%s (%d-%d)", r.Name, r.LinkKarma, r.CommentKarma)
}