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;
|
2016-08-16 12:11:45 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-07-15 03:04:16 +00:00
|
|
|
|
public interface IGoogleApiService : INService
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
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);
|
2016-08-21 22:37:39 +00:00
|
|
|
|
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);
|
2016-08-21 14:16:11 +00:00
|
|
|
|
|
|
|
|
|
Task<string> ShortenUrl(string url);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|