NadekoBot/NadekoBot.Core/Services/IGoogleApiService.cs

36 lines
1.3 KiB
C#
Raw Normal View History

2017-05-27 08:19:27 +00:00
using Google.Apis.Customsearch.v1.Data;
using System;
2016-10-19 10:40:43 +00:00
using System.Collections.Generic;
using System.Threading.Tasks;
namespace NadekoBot.Core.Services
{
public interface IGoogleApiService : INService
{
2017-05-27 08:19:27 +00:00
IEnumerable<string> Languages { get; }
2017-06-13 12:21:24 +00:00
Task<IEnumerable<string>> GetVideoLinksByKeywordAsync(string keywords, int count = 1);
Task<IEnumerable<(string Name, string Id, string Url)>> GetVideoInfosByKeywordAsync(string keywords, int count = 1);
Task<IEnumerable<string>> GetPlaylistIdsByKeywordsAsync(string keywords, int count = 1);
Task<IEnumerable<string>> GetRelatedVideosAsync(string url, int count = 1);
Task<IEnumerable<string>> GetPlaylistTracksAsync(string playlistId, int count = 50);
2016-10-19 10:40:43 +00:00
Task<IReadOnlyDictionary<string, TimeSpan>> GetVideoDurationsAsync(IEnumerable<string> videoIds);
2017-05-27 08:19:27 +00:00
Task<ImageResult> GetImageAsync(string query, int start = 1);
Task<string> Translate(string sourceText, string sourceLanguage, string targetLanguage);
Task<string> ShortenUrl(string url);
}
2017-05-27 08:19:27 +00:00
public struct ImageResult
{
public Result.ImageData Image { get; }
public string Link { get; }
public ImageResult(Result.ImageData image, string link)
{
this.Image = image;
this.Link = link;
}
}
}