Skip to content

melihmucuk/hugo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hugo GoDoc Go Report Card

Hürriyet API Wrapper For Golang

Install

$ go get github.com/melihmucuk/hugo

Example

package main

import (
	"fmt"
	"github.com/melihmucuk/hugo"
)

func main() {
	h := hugo.NewHurriyetAPI("YOUR_API_KEY")

	query := &hugo.Query{Top: 10}
	articles, _ := h.ListArticles(query)
	fmt.Println("articles count => ", len(articles))

	article, _ := h.SingleArticle(articles[0].ID, nil)
	fmt.Println("article => ", article)

	searchQuery := &hugo.Query{S: "1", Skip: 50, Top: 50} // default: -1, -1 => new to old , 1 => old to new
	searchResults, _ := h.Search("reina", searchQuery)
	fmt.Println("results found => ", searchResults.Count)

	writers, _ := h.ListWriters(nil)
	fmt.Println("writers count => ", len(writers))

	writer, _ := h.SingleWriter(writers[2].ID, nil)
	fmt.Println("writer => ", writer)

	galleryQuery := &hugo.Query{Filter: "Path eq '/teknoloji/'", Top: 5}
	galleries, _ := h.ListPhotoGalleries(galleryQuery)
	fmt.Println("photo galleries about 'teknoloji' => ", len(galleries))

}

TODO

  • Article
  • Search
  • Writer
  • Path
  • Page
  • News Photo Gallery
  • Date
  • Column
  • Test

Releases

No releases published

Packages

No packages published

Languages