Skip to content

Commit

Permalink
Merge pull request #6 from Velka-DEV/dev
Browse files Browse the repository at this point in the history
Updated solution projects structure
  • Loading branch information
Velka-DEV authored Jan 30, 2023
2 parents 3a00a4c + c1d65b3 commit 0a1ce40
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Migale.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migale.Core", "src\Migale.Core\Migale.Core.csproj", "{03B9608F-0DB1-47A2-83FE-7291EFFCB4A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migale.HttpClient", "src\Migale.HttpClient\Migale.HttpClient.csproj", "{8F745643-773F-4659-B1AA-6549C764243C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migale.Crawlers.HttpClient", "src\Migale.Crawlers.HttpClient\Migale.Crawlers.HttpClient.csproj", "{8F745643-773F-4659-B1AA-6549C764243C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migale.Playwright", "src\Migale.Playwright\Migale.Playwright.csproj", "{CAD870A7-B128-47D3-BF0A-4AF93C54EF39}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migale.Crawlers.Playwright", "src\Migale.Crawlers.Playwright\Migale.Crawlers.Playwright.csproj", "{CAD870A7-B128-47D3-BF0A-4AF93C54EF39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migale.Samples", "src\Migale.Samples\Migale.Samples.csproj", "{BFB05798-590D-42CA-A82E-5982024C28D7}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Migale.Core;
using Migale.Core.Models;

namespace Migale.HttpClient.Extensions;
namespace Migale.Crawlers.HttpClient.Extensions;

public static class MigaleBuilderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Migale.Core.Crawlers;
using Migale.Core.Models;

namespace Migale.HttpClient;
namespace Migale.Crawlers.HttpClient;

public class HttpClientCrawler : ICrawler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Text.RegularExpressions;
using Microsoft.Playwright;
using Migale.Core;
using Migale.Playwright.Models;
using Migale.Crawlers.Playwright.Models;

namespace Migale.Playwright.Extensions;
namespace Migale.Crawlers.Playwright.Extensions;

public static class MigaleBuilderExtension
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Migale.Playwright.Models;
namespace Migale.Crawlers.Playwright.Models;

public class PlaywrightCrawlerOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Migale.Core.Crawlers;
using Migale.Core.Models;

namespace Migale.Playwright;
namespace Migale.Crawlers.Playwright;

public class PlaywrightCrawler : ICrawler, IAsyncDisposable
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migale.Samples/Migale.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Migale.HttpClient\Migale.HttpClient.csproj" />
<ProjectReference Include="..\Migale.Playwright\Migale.Playwright.csproj" />
<ProjectReference Include="..\Migale.Crawlers.HttpClient\Migale.Crawlers.HttpClient.csproj" />
<ProjectReference Include="..\Migale.Crawlers.Playwright\Migale.Crawlers.Playwright.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Migale.Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

using Migale.Samples.samples;

await HttpClientSample.RunHttpClientMigaleAsync();
await PlaywrightSample.RunPlaywrightMigaleAsync();
2 changes: 1 addition & 1 deletion src/Migale.Samples/samples/HttpClientSample.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Migale.Core;
using Migale.HttpClient.Extensions;
using Migale.Crawlers.HttpClient.Extensions;

namespace Migale.Samples.samples;

Expand Down
9 changes: 5 additions & 4 deletions src/Migale.Samples/samples/PlaywrightSample.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Migale.Core;
using Migale.Core.Models;
using Migale.Playwright.Extensions;
using Migale.Playwright.Models;
using Migale.Crawlers.Playwright.Extensions;
using Migale.Crawlers.Playwright.Models;

namespace Migale.Samples.samples;

Expand All @@ -20,11 +20,11 @@ public static async Task RunPlaywrightMigaleAsync()
builder.WithPlaywrightCrawler(new PlaywrightCrawlerOptions()
{
Headless = false,
BrowserInstances = 1
BrowserInstances = 2
});
builder.WithOptions(new MigaleOptions()
{
Threads = 1
Threads = 2
});

var spider = builder.Build();
Expand All @@ -37,6 +37,7 @@ public static async Task RunPlaywrightMigaleAsync()
spider.PageCrawled += (sender, e) =>
{
Console.WriteLine($"Crawled {e.Target.Url}");
Console.WriteLine(e.Result.Content);
};

spider.PageCrawlFailed += (sender, e) =>
Expand Down

0 comments on commit 0a1ce40

Please sign in to comment.