Module: Shikimori::API::V2::EpisodeNotifications

Included in:
Shikimori::API::V2
Defined in:
lib/shikimori/api/v2/episode_notifications.rb

Overview

Methods for the Episode notifications API

Instance Method Summary collapse

Instance Method Details

#create_episode_notification(episode_notification, token:, headers: nil, **query) ⇒ Hash

Notify shikimori about anime episode release

Examples:

client = Shikimori::API::Client.new(
           app_name: 'Api Test',
           aceess_token: '****',
           refresh_token: '****'
         )

notification = {
  aired_at: "2022-11-19T17:19:31+03:00",
  anime_id: "35",
  episode: "3",
  is_anime365: "true",
  is_fandub: "true",
  is_raw: "false",
  is_subtitles: "false"
 }
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

client.v2.create_episode_notification(notification, token: token)

Parameters:

  • episode_notification (Hash)

    Episode notification data for creating

  • token (String)

    Private token required to access this api

  • headers (Hash) (defaults to: nil)

    Request headers

  • query (Hash)

    Query string parameters for request

Options Hash (episode_notification):

  • :anime_id (Integer)

    Anime id

  • :episode (Integer)

    Episode number

  • :aired_at (String)

    Date and time of aired

  • :is_fandub ('true', 'false', 1, 0)

    Is fandub?

  • :is_raw ('true', 'false', 1, 0)

    Is raw?

  • :is_subtitles ('true', 'false', 1, 0)

    Is with subtitles?

  • :is_anime365 ('true', 'false', 1, 0)

    Is Anime365?

Returns:

  • (Hash)

    Hash representing created episode notification

See Also:



46
47
48
49
50
# File 'lib/shikimori/api/v2/episode_notifications.rb', line 46

def create_episode_notification(episode_notification, token:, headers: nil, **query)
  rest.post base_url.join('episode_notifications').url,
            { episode_notification: episode_notification, token: token },
            headers: headers, query: query
end