Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hiya

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hiya

  • 0.2.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Hiya

iiil.io SDK

Installation

You can add it to your Gemfile with:

$ gem install hiya

Configure

Override any of these defaults in config/initializers/clearance.rb:

Hiya.configure do |config|
  config.api_url = 'https://api.iiil.io/v1'

  # source: only support api/line/telegram/messenger
  config.source = 'api'
end

Usage

links = [
  { url: 'https://www.google.coom', weight: 1 }
]
Hiya::Url.new.create(links)
files = [
  '/Users/username/Desktop/aaa.jpg',
  '/Users/username/Desktop/bbb.png',
  '/Users/username/Desktop/ccc.gif'
]
Hiya::Image.new.create(files, {
  attach: {
    password: '1234',
    password_note: 'today',
    expired_num: 300,
    view_count_limit: 100
  },
  post: {
    content: "haha\nhttps://www.google.com"
  }
})
files = [
  '/Users/username/Desktop/aaa.mp4',
  '/Users/username/Desktop/bbb.mp4'
]
Hiya::Video.new.create(files, {
  attach: {
    password: '1234',
    password_note: 'today',
    expired_num: 300,
    view_count_limit: 100
  },
  post: {
    content: "yoyo\nhttps://www.google.com"
  }
})
files = [
  '/Users/username/Desktop/aaa.mp3',
  '/Users/username/Desktop/bbb.mp3',
  '/Users/username/Desktop/ccc.mp3'
]
Hiya::Audio.new.create(files, {
  attach: {
    password: '1234',
    password_note: 'today',
    expired_num: 300,
    view_count_limit: 100
  },
  post: {
    content: "hehe\nhttps://www.google.com"
  }
})

Login - get token

params = {
  grant_type: 'password', # required

  # facebook
  facebook_token: '<facebook_token>', # facebook token(String)
  # google
  google_token: '<google_token>', # google token(String)
  google_refresh_token: '<google_refresh_token>', # google refresh token(String)
  # line
  line_token: '<line_token>', # line token(String)
  # chatbot
  chatbot_token: '<chatbot_token>', # chatbot token(String)
}
response =  Hiya::Oauth.new.token(params)

puts response
{
  access_token: '-qsizxNy83YTh7kdnZ7f20mKpty00-G0SidjWitGj0g',
  token_type: 'Bearer',
  created_at: 1688109992
}

# use user token create short link
links = [
  { url: 'https://www.google.coom', weight: 1 }
]
Hiya::Url.new(response[:token]).create(links)
Hiya::Users::Links.new(response[:token]).all
Hiya::Users::Links.new(response[:token]).find(code)
Hiya::Users::Links.new(response[:token]).analytic(code)
files = [
  '/Users/username/Desktop/aaa.jpg',
  '/Users/username/Desktop/bbb.png',
  '/Users/username/Desktop/ccc.gif'
]
Hiya::Users::Links.new(response[:token]).attach_files(code, files)
params = {
  attach: {
    password: 'kopi',
    password_note: 'こぴ / kopi',
    view_count_limit: 9999
  },
  post: {
    content: "こぴ / kopi\nhttps://youtu.be/kmPgjr0EL64"
  }
}
Hiya::Users::Links.new(response[:token]).update(code, params)
params = {
  ip: String: "125.227.100.100",
  hostname: String: "125-227-100-100.hinet-ip.hinet.net",
  city: String: "Taipei",
  region: String: "Taiwan",
  country: String: "TW",
  loc: String: "25.0418,121.5359",
  org: String: "AS3462 Data Communication Business Group",
  timezone: String: "Asia/Taipei"
}
Hiya::Users::Links.new(response[:token]).update_ip_info(code, params)
Hiya::Users::Links.new(response[:token]).destroy(code)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/iiil-io/hiya.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 16 Aug 2023

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