ghanamps

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 5 Imported by: 0

README

ghanamps A simple cli and server that returns a JSON of all the members of parliament in Ghana.

LIVE WEB VERSION

You can simply make a request to this URL to get the JSON:
https://ghanamps.herokuapp.com

INSTALLATION

Installation with Go installed

If you already have Go on your machine you can simply install this tool by running:

go install github.com/yeboahnanaosei/ghanamps/cmd/ghanamps@latest

This will install a binary ghanamps to the bin folder in your $GOPATH.

Installation without Go installed

  1. Go to the releases page and download the appropriate binary for your system.

  2. Extract the binary from the zip archive

  3. Put the binary in your PATH environment variable and make sure it is executable (Linux & macOS)

    If you don't know how to do this, here is a useful link to guide you: https://zwbetz.com/how-to-add-a-binary-to-your-path-on-macos-linux-windows/

  4. Launch your command prompt and run:

  1. ghanamps members for all members
  2. ghanamps leaders for all leaders
  3. ghanamps -h for help

USAGE

The tool has two subcommands:
members for handling members
leaders for handling the leaders

Get members

To get members you can run the tool by simply issuing the following command from your terminal.

ghanamps members

This will return a JSON array of all the current members of Ghana's parliament. Example below:

[
    {
     "name": "ADAMA  SULEMANA",
     "party": "NDC",
     "constituency": "TAIN CONSTITUENCY",
     "region": "BONO REGION",
     "photo": "https://www.parliament.gh/epanel/mps/photos/198.jpg",
     "profile": "https://www.parliament.gh/mps?mp=198"
   },
   {
     "name": "ADELAIDE  NTIM",
     "party": "NPP",
     "constituency": "NSUTA/KWAMAN BEPOSO CONSTITUENCY",
     "region": "ASHANTI REGION",
     "photo": "https://www.parliament.gh/epanel/mps/photos/164.jpg",
     "profile": "https://www.parliament.gh/mps?mp=164"
   },
   {
     "name": "AGNES NAA MOMO LARTEY",
     "party": "NDC",
     "constituency": "KROWOR CONSTITUENCY",
     "region": "GREATER ACCRA REGION",
     "photo": "https://www.parliament.gh/epanel/mps/photos/64.jpg",
     "profile": "https://www.parliament.gh/mps?mp=64"
   },
   {
     "name": "AKWASI  DARKO BOATENG",
     "party": "NPP",
     "constituency": "BOSOME FREHO CONSTITUENCY",
     "region": "ASHANTI REGION",
     "photo": "https://www.parliament.gh/epanel/mps/photos/133.jpg",
     "profile": "https://www.parliament.gh/mps?mp=133"
   },
   {
     "name": "AKWASI  KONADU",
     "party": "NPP",
     "constituency": "MANHYIA NORTH CONSTITUENCY",
     "region": "ASHANTI REGION",
     "photo": "https://www.parliament.gh/epanel/mps/photos/145.jpg",
     "profile": "https://www.parliament.gh/mps?mp=145"
   }
   ...
]

To get members of a particular party, you can issue the following command:

ghanamps members -party npp
ghanamps members -party ndc
ghanamps members -party independent
Get leaders

To get the leadership of parliament, you can run the tool by simply issuing the following command from your terminal:

ghanamps leaders

This will return a JSON array of all the current leaders of Ghana's parliament. Example below:

[
   {
     "name": "Rt. Hon. Alban Sumana Kingsford Bagbin",
     "title": "Speaker of Parliament",
     "photo": "https://www.parliament.gh/epanel/mps/leaders/MrSpeaker.jpg"
   },
   {
     "name": "Hon. Joseph Osei-Owusu",
     "title": "First Deputy Speaker",
     "photo": "https://www.parliament.gh/epanel/mps/photos/132.jpg"
   },
   {
     "name": "Hon. Andrew Asiamah Amoako",
     "title": "Second Deputy Speaker",
     "photo": "https://www.parliament.gh/epanel/mps/photos/128.jpg"
   },
   ...
]

WANT TO CONTRIBUTE?

Of course! Ideas, suggestions, additions are all welcome. Read this

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leader added in v0.0.4

type Leader struct {
	ID    string `json:"-"`
	Name  string `json:"name"`
	Title string `json:"title"`
	Photo string `json:"photo"`
}

Leader represents a leader of parliament

func Leaders added in v0.0.4

func Leaders() ([]Leader, error)

Leaders returns a JSON data of the leadership of the parliament.

type Member

type Member struct {
	ID           string `json:"-"`
	Name         string `json:"name"`
	Party        string `json:"party"`
	PartyAbbr    string `json:"partyAbbr"`
	Constituency string `json:"constituency"`
	Region       string `json:"region"`
	Photo        string `json:"photo"`
	Profile      string `json:"profile"`
}

Member represents the details of one member of parliament

func Fetch

func Fetch() ([]Member, error)

Fetch fetches the current members of parliament.

func Members added in v0.0.4

func Members() ([]Member, error)

Members is an alias of Fetch.

Directories

Path Synopsis
cmd
ghanamps
This is the cli tool for ghanamps.
This is the cli tool for ghanamps.
ghanampsd
This is the source code for the ghanamps web server called 'ghanampsd'.
This is the source code for the ghanamps web server called 'ghanampsd'.

Jump to

Keyboard shortcuts

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