Giter Site home page Giter Site logo

kktix-api's Introduction

KKTIX API Gem

Gem Version Build Status

kktix_api is a gem that gets event information of an organization from KKTIX

Installation

If you are working on a project, add this to your Gemfile: gem 'kktix_api'

For ad hoc installation from command line:

$ gem install kktix_api

Usage

Execute kktix of an organization with specific organization_id; Otherwise, get latest published events.

$ kktix [org_id]

API

Require kktix_api gem in your code:

require 'kktix_api'

Get information using domain class Organization, you can get attributes like name, uri, and all the events held by the organization.

organization = KktixEvent::Organization.find('<organization_id>')

List events information from an Organization, including url, published, title,  summary, content, and author.

organization.events.each do |event|
  puts "#{event.title} (#{event.published})"
  puts event.url
  puts event.content
  puts
end

See the following example code for more usage details:

oid = 'nthuion'

acts = KktixEvent::KktixApi.events(oid)
puts acts

organization = KktixEvent::Organization.find(oid)
puts organization.name, organization.uri
organization.events.each do |event|
  puts event.title, event.published
end

kktix-api's People

Contributors

dspp779 avatar coolcircle avatar shannywu avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Forkers

ytl0623

kktix-api's Issues

Is this still work now?

Hi, May I ask if this method still works now?
I tried to use this method but got some errors.

C:\Users\user>kktix nthuion
Search for nthuion...
C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/kktix_api-1.0.0/lib/kktix-api/kktix_api.rb:20:in `search': undefined method `escape' for URI:Module (NoMethodError)

      uri = URI.escape("https://kktix.com/events?start_at=#{start_at}&search=#{query}")
               ^^^^^^^
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/kktix_api-1.0.0/lib/kktix-api/event.rb:14:in `search'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/kktix_api-1.0.0/bin/kktix:13:in `<top (required)>'
        from C:/Ruby32-x64/bin/kktix:32:in `load'
        from C:/Ruby32-x64/bin/kktix:32:in `<main>'

Could you please help me solve it?
Thanks in advance!!

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.