Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.
/ jishoapi Public archive

A vlang library that provides a jisho.org API interface.

License

Notifications You must be signed in to change notification settings

inokawazu/jishoapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jishoapi

A vlang library that provides a jisho.org API interface.

API

The JishoWordSearch struct is used to encapsulate the a API called to jisho.org's free api. The keyword field must be specified which is the keyword query term used in the jisho.org API. page is an int field that represents the requested page. The method .search() performs the API called with the specific JishoWordSearch, mutating the response.

Example (CLI App)

This example code is a simple CLI app that prints (ugly) wordreadings and misc stuff from a search. The usage is ./appname <jisho query>.

module main
import os
import jishoapi {JishoWordSearch}

fn main() {

	if os.args.len>1 {
		search_string := os.args[1..].join(" ")
		mut jws := JishoWordSearch{keyword: search_string}
		jws.search()?

		for ent in jws.response.data {
			println("WordReadings: ${ent.wordreadings} ")
			println("WordReadings: ${ent.senses} ")
			println("")
		}

	}

}

About

A vlang library that provides a jisho.org API interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published