Giter Site home page Giter Site logo

iarmankarimi / open-notify-api-elixir Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

Open Notify API client for elixir

License: MIT License

Elixir 100.00%
api api-client api-wrapper iss iss-location nasa-data open-notify open-notify-api open-notify-api-client open-notify-api-wrapper

open-notify-api-elixir's Introduction

Open Notify API (elixir)

Open Nofity API client for elixir

Open Notify is an open source project to provide a simple programming interface for some of NASA’s awesome data.

For other languages, see Open Notify API clients

Installation

Examples

Number of People in Space:

  case OpenNotifyApi.get_people_in_space() do
    {:ok, people_in_space} ->
      number = people_in_space["number"]
      IO.puts("There are \#{number} people in space right now.")

      people = people_in_space["people"]
      IO.puts("List of people in space:")

      for person <- people do
        name = person["name"]
        craft = person["craft"]
        IO.puts("name: \#{name}, craft: \#{craft}")
      end

    {:error, error} ->
      IO.puts(error)
  end

Current Location of the International Space Station:

  case OpenNotifyApi.get_iss_location() do
    {:ok, iss_location} ->
      IO.puts("Current location of International Space Station:")
      IO.puts("latitude: \#{iss_location.latitude}")
      IO.puts("longitude: \#{iss_location.longitude}")

      iss_location["timestamp"]
      |> DateTime.from_unix()
      |> case do
        {:ok, date_time} -> "Date and time: \#{date_time}" |> IO.puts()
      end

    {:error, error} ->
      IO.inspect(error)
  end

References

Open Notify Website

Official API documentation

License

MIT

open-notify-api-elixir's People

Contributors

iarmankarimi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.