From 63f986e3570117a8f36e7064da722551a225f5a5 Mon Sep 17 00:00:00 2001 From: GrabzIt Date: Tue, 15 Oct 2019 13:36:46 +0100 Subject: [PATCH] Initial support for SEO API --- aspnet/GrabzIt/COM/IGrabzItClient.cs | 1 + aspnet/GrabzIt/COM/ISEOOptions.cs | 66 ++++++++++++++++++++++++++++ aspnet/GrabzIt/GrabzItClient.cs | 18 ++++++++ 3 files changed, 85 insertions(+) create mode 100644 aspnet/GrabzIt/COM/ISEOOptions.cs diff --git a/aspnet/GrabzIt/COM/IGrabzItClient.cs b/aspnet/GrabzIt/COM/IGrabzItClient.cs index 44fd2a6c..043dd273 100644 --- a/aspnet/GrabzIt/COM/IGrabzItClient.cs +++ b/aspnet/GrabzIt/COM/IGrabzItClient.cs @@ -21,6 +21,7 @@ public interface IGrabzItClient string CreateEncryptionKey(); void Decrypt(string path, string key); void URLToAnimation(string url, AnimationOptions options); + void URLToSEOReport(string url, SEOOptions options); void URLToImage(string url, ImageOptions options); void URLToPDF(string url, PDFOptions options); void URLToTable(string url, TableOptions options); diff --git a/aspnet/GrabzIt/COM/ISEOOptions.cs b/aspnet/GrabzIt/COM/ISEOOptions.cs new file mode 100644 index 00000000..0eed9f25 --- /dev/null +++ b/aspnet/GrabzIt/COM/ISEOOptions.cs @@ -0,0 +1,66 @@ +using GrabzIt.Enums; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace GrabzIt.COM +{ + [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] + interface ISEOOptions + { + Country Country + { + get; + set; + } + + string ExportURL + { + get; + set; + } + + string EncryptionKey + { + get; + set; + } + + string CustomId + { + get; + set; + } + + int BrowserWidth + { + get; + set; + } + + int BrowserHeight + { + get; + set; + } + + int Delay + { + get; + set; + } + + bool NoAds + { + get; + set; + } + + string Proxy + { + get; + set; + } + } +} diff --git a/aspnet/GrabzIt/GrabzItClient.cs b/aspnet/GrabzIt/GrabzItClient.cs index 0a50326f..ca27ed66 100644 --- a/aspnet/GrabzIt/GrabzItClient.cs +++ b/aspnet/GrabzIt/GrabzItClient.cs @@ -249,6 +249,24 @@ public void URLToAnimation(string url, AnimationOptions options) } } + /// + /// This method specifies the URL of the web page that should be converted into a SEO report. + /// + /// The URL to convert into a report. + /// A instance of the SEOOptions class that defines any special options to use when creating the report. + public void URLToSEOReport(string url, SEOOptions options) + { + lock (thisLock) + { + if (options == null) + { + options = new SEOOptions(); + } + + request.Store(GetRootURL(false) + "takeseo.ashx", false, options, url); + } + } + /// /// This method specifies the URL that should be converted into a image screenshot. ///