New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

Midna

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Midna

  • 0.9.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= midna

Ruby interface to the Midna API. See the [Rdoc]http://rdoc.info/projects/tilsammans/midna on how to use it.

This gem chats with the Midna API so you don't have to. It will give you objects in the Midna namespace, which you can query like Active Record:

Information about a Broadcaster, such as AVRO

Midna::Broadcaster.find('avro')

All series for the given Broadcaster

Midna::Broadcaster.series('avro')

all channels

Midna::Channel.all

alphanumeric; like NL1

Midna::Channel.find(code)

series ID from the omroep player

Midna::Series.find(id)

searches the Solr index by series name

Midna::Series.search(query)

aflevering/episode ID from the omroep player

Midna::Episode.find(id)

all episodes for the given Series

Midna::Episode.series(id)

all episodes for the given Series in the given time window

start and end are integers (unixtimes)

Midna::Episode.series_window(id, start, end)

all episodes for the given Series until the given time

start is an integer (unixtime) and defaults to the current time

Midna::Episode.series_until(id, start) Midna::Episode.series_until(id, start, :page => 2)

all episodes for the given Series since the given time

start is an integer (unixtime) and defaults to the current time

Midna::Episode.series_since(id, start) Midna::Episode.series_since(id, start, :page => 2)

code is Channel code

Midna::Broadcast.channel(code)

all broadcasts for the given Channel in the given time window

start and end are integers (unixtimes)

Midna::Broadcast.channel_window(id, start, end)

All of these methods will return hashes or arrays of hashes.

Also, Midna is Zelda's goth sister.

== Installation in Rails

Install this plugin as a gem.

For Rails 2, in config/environment.rb

config.gem 'midna'

For Rails 3, in Gemfile

gem 'midna'

Then run rake gems:install.

== Usage in plain Ruby

First install the gem on your machine like usual:

$ gem install midna

Use sudo if your setup requires it. After this you can require it in your code and work with Midna from there.

require 'rubygems' require 'midna'

puts Midna::Channel.all

=> [{"name"=>"Nederland 1", "code"=>"NL1"}, {"name"=>"Nederland 2", "code"=>"NL2"}, {"name"=>"Nederland 3 & Z@pp", "code"=>"NL3"}]

== Configuration

If you are using rails, create a file called config/initializers/midna.rb with the following configuration. If you are using the gem, execute these lines before you first call any Midna objects.

The gem connects to midna.omroep.nl by default. You can override this by setting the +base_uri+:

Midna.base_uri = 'http://some.other.host'

== Prerequisites

The HTTparty[http://github.com/jnunemaker/httparty] gem.

gem install httparty

== Copyright

Copyright (c) 2010 Joost Baaij. See LICENSE for details.

FAQs

Package last updated on 05 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc