Categorygithub.com/dfkdream/godc
2.0.2
Repository: https://github.com/dfkdream/godc.git
Documentation: pkg.go.dev

# README

godc

Go Report Card GoDoc

디시인사이드 비공식 API

게시글 목록,게시글 내용, 갤러리 목록 읽기 기능만 지원하고 있습니다. 나머지 기능은 추가 예정

Install

go get github.com/dfkdream/godc/v2

Document

Writer

필드 이름자료형설명
Namestring작성자 이름
Identitystring작성자 ID/IP
IsSignedInbool로그인 여부

ArticleData

필드 이름자료형설명
URLstring게시글 URL
Titlestring게시글 제목
Typestring게시글 타입
Tagstring게시글 말머리
ReplyCountstring댓글 수
Timestampstring작성 시간
ViewCounterstring조회수
UpVotestring추천 수
WriterWriter작성자

ArticleData.Type

string설명
ico_pic ico_t텍스트만
ico_pic ico_p_y이미지 포함
ico_pic ico_mv동영상 포함
ico_pic ico_t_c텍스트만, 개념글
ico_pic ico_p_c이미지 포함, 개념글

ArticleBody

필드 이름자료형설명
Titlestring게시글 제목
Timestampstring작성 시간
ViewCounterstring조회수
ReplyCountstring댓글 수
Bodystring(HTML)게시글 내용
UpVotestring추천 수
DownVotestring비추천 수
Replies[]Reply댓글
WriterWriter작성자

Reply

필드 이름자료형설명
Typestring댓글(reply)/대댓글(re-reply) 구분
Bodystring(HTML)댓글 내용
Timestampstring작성 시간
WriterWriter작성자

GallInfo

필드 이름자료형설명
Categorystring갤러리 카테고리
Namestring갤러리 코드
KoNamestring갤러리 이름
Managerstring매니저 ID
SubManagerstring( , 로 구분)부매니저 ID
Nostring겔러리 번호

Example Code

GalleryID 갤러리의 게시글 목록 1페이지를 읽어옵니다.

package main

import (
	"fmt"
	"log"

	"github.com/dfkdream/godc/v2"
)

func main() {
	dat, err := godc.FetchArticleList("<GalleryID>", 1, false)

	if err != nil {
		log.Fatal(err)
	}

	for index, data := range dat {
		fmt.Printf("=============article%d==============\n", index)
		fmt.Printf("URL: %s\nTitle: %s\nType: %s\nReplyCount: %s\nTimestamp : %s\nViewCount : %s\nUpVote : %s\nWriter : %+v",
			data.URL,
			data.Title,
			data.Type,
			data.ReplyCount,
			data.Timestamp,
			data.ViewCount,
			data.UpVote,
			data.Writer)
	}
}

# Packages

Package godc reads list of posts from the DCInside Gallery.