summaryrefslogtreecommitdiff
path: root/struct.go
diff options
context:
space:
mode:
authoradmin2025-02-09 15:07:02 +0100
committeradmin2025-02-09 15:07:02 +0100
commit32369fcbd4285664a527846ed392a33bbcbc3d75 (patch)
treeaabb365003b7a0b4c3a278bae117e28ff2c9c3a7 /struct.go
parenta82dd3752342b0096a5070d297189b0bdf9ffe34 (diff)
downloadhncrawler-master.tar.gz
FixURLs()HEADmaster
Diffstat (limited to 'struct.go')
-rw-r--r--struct.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/struct.go b/struct.go
index 2b7538a..568205e 100644
--- a/struct.go
+++ b/struct.go
@@ -5,25 +5,28 @@ import (
)
type Story struct {
- Id int
+ Id int
//Deleted bool
- Type string /* story, comment (or job, poll, pollopt) */
- Title string /* title (only story) */
- Text string /* comment text or possible text on story (HTML) */
- Dead bool
- Url string /* verbatim parsed URL */
+ Type string /* story, comment (or job, poll, pollopt) */
+ Title string /* title (only story) */
+ Text string /* comment text or possible text on story (HTML) */
+ Dead bool
+ Url string /* verbatim parsed URL */
//NormalizedUrl string /* normalized */
- Score int /* only story */
- Descendants int /* comments on score or kids on comments */
+ Score int /* only story */
+ Descendants int /* comments on score or kids on comments */
//Kids []int /* id of the item's comments */
- Time int /* posted at */
- By string /* hn commenter */
- Links []Link /* matched urls */
+ Time int /* posted at */
+ By string /* hn commenter */
+ Links []Link /* matched urls */
}
type Link struct {
- Url string
- Field int /* 2 = video, 1 = movies, 0 = bug */
+ Url string
+ Field int /* 2 = video, 1 = movies, 0 = bug */
+ Host string /* e.g. "youtube.com", "imdb.com" */
+ Param string /* e.g. "v" param for youtube, title/"ttxxx" for imdb */
+ Type string /* e.g. "video", "channel", "playlist" */
}
type URL struct {
@@ -31,5 +34,5 @@ type URL struct {
type syncMaxItem struct {
max_item int
- mu sync.Mutex
+ mu sync.Mutex
}