2017-05-27 10:19:27 +02:00
|
|
|
|
using Google.Apis.Customsearch.v1.Data;
|
|
|
|
|
using System;
|
2016-10-19 12:40:43 +02:00
|
|
|
|
using System.Collections.Generic;
|
2016-08-16 14:11:45 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2017-10-13 06:14:54 +02:00
|
|
|
|
namespace NadekoBot.Core.Services
|
2016-08-16 14:11:45 +02:00
|
|
|
|
{
|
2017-07-15 05:04:16 +02:00
|
|
|
|
public interface IGoogleApiService : INService
|
2016-08-16 14:11:45 +02:00
|
|
|
|
{
|
2017-05-27 10:19:27 +02:00
|
|
|
|
IEnumerable<string> Languages { get; }
|
|
|
|
|
|
2017-06-13 14:21:24 +02: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-22 00:37:39 +02: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 12:40:43 +02:00
|
|
|
|
Task<IReadOnlyDictionary<string, TimeSpan>> GetVideoDurationsAsync(IEnumerable<string> videoIds);
|
2017-05-27 10:19:27 +02:00
|
|
|
|
Task<ImageResult> GetImageAsync(string query, int start = 1);
|
|
|
|
|
Task<string> Translate(string sourceText, string sourceLanguage, string targetLanguage);
|
2016-08-21 16:16:11 +02:00
|
|
|
|
|
|
|
|
|
Task<string> ShortenUrl(string url);
|
2016-08-16 14:11:45 +02:00
|
|
|
|
}
|
2017-05-27 10:19:27 +02: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 14:11:45 +02:00
|
|
|
|
}
|