Skip to content

Commit

Permalink
Initial support for SEO API
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabzIt committed Oct 15, 2019
1 parent 5f3da79 commit 63f986e
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions aspnet/GrabzIt/COM/IGrabzItClient.cs
Expand Up @@ -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);
Expand Down
66 changes: 66 additions & 0 deletions 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;
}
}
}
18 changes: 18 additions & 0 deletions aspnet/GrabzIt/GrabzItClient.cs
Expand Up @@ -249,6 +249,24 @@ public void URLToAnimation(string url, AnimationOptions options)
}
}

/// <summary>
/// This method specifies the URL of the web page that should be converted into a SEO report.
/// </summary>
/// <param name="url">The URL to convert into a report.</param>
/// <param name="options">A instance of the SEOOptions class that defines any special options to use when creating the report.</param>
public void URLToSEOReport(string url, SEOOptions options)
{
lock (thisLock)
{
if (options == null)
{
options = new SEOOptions();
}

request.Store(GetRootURL(false) + "takeseo.ashx", false, options, url);
}
}

/// <summary>
/// This method specifies the URL that should be converted into a image screenshot.
/// </summary>
Expand Down

0 comments on commit 63f986e

Please sign in to comment.