goarxiv

package module
v0.0.0-...-d426342 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2015 License: MIT Imports: 6 Imported by: 1

README

goarxiv Build Status GoDoc

A Go API wrapper around the arXiv.org API. Provides simple access to the search query and returns in a simple Atom XML struct format.

How to

go get github.com/devincarr/goarxiv

and

import github.com/devincarr/goarxiv
// Build a new search struct
s := goarxiv.New()

// Add some search parameters
s.AddQuery("search_query","cat:cs.LG")

// Get the results and print first article
result, error := s.Get()
if error != nil { error }
fmt.Println(result.Entry[0].Title)

// "Hierarchical Reinforcement Learning with the MAXQ Value Function
  Decomposition"
Result Format

The results from the arXiv.org API are in Atom XMl format and goarxiv utilizes golang.org/x/tools/blog/atom for the results parsing. See godoc/atom for the format of the results.

License

The MIT License (MIT)

Documentation

Overview

A Go API wrapper around the arXiv.org (arxiv.org/help/api/user-manual). Provides simple access to the search query and returns in a simple Atom XML struct format. Made by Devin Carr (http://github.com/devincarr/goarxiv) Licensed under MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(res *http.Response) (*atom.Feed, error)

Read the Http response and return an atom.Feed

Types

type Search struct {
	Query  url.Values
	Url    url.URL
	Result *atom.Feed
}

Search represents a single instance of a search query to arxiv.org

func New

func New() *Search

New constructs and returns a new Search.

func (*Search) AddQuery

func (s *Search) AddQuery(key string, value string) error

AddQuery adds a new search query (key=value) to the Search.

func (*Search) Build

func (s *Search) Build() error

Build checks and completes the search query string.

func (*Search) Get

func (s *Search) Get() (*atom.Feed, error)

Get parses the Url and completes an HTTP request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL