-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
26 changed files
with
246 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Confluent.Kafka" Version="0.11.5" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Confluent.Kafka; | ||
using Confluent.Kafka.Serialization; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Text; | ||
|
||
namespace DotnetSpider.Broker | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var config = new Dictionary<string, object> | ||
{ | ||
{ "bootstrap.servers", "192.168.90.106:9092" } | ||
}; | ||
|
||
using (var producer = new Producer<Null, string>(config, null, new StringSerializer(Encoding.UTF8))) | ||
{ | ||
for (int i = 0; i < 1000; ++i) | ||
{ | ||
var dr = producer.ProduceAsync("my-topic", null, "test message text").Result; | ||
Console.WriteLine($"Delivered '{dr.Value}' to: {dr.TopicPartitionOffset}"); | ||
} | ||
} | ||
Console.Read(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<TargetFrameworks>net40;net45;netstandard2.0</TargetFrameworks> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<Version>3.0.1</Version> | ||
<Version>3.0.2</Version> | ||
<Authors>[email protected];</Authors> | ||
<AssemblyName>DotnetSpider.Core</AssemblyName> | ||
<Copyright>Copyright 2018 Lewis Zou</Copyright> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using DotnetSpider.Core; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace DotnetSpider.Extension | ||
{ | ||
public class ConfigurableSpider : Spider | ||
{ | ||
private readonly string _json; | ||
|
||
public ConfigurableSpider(string json) | ||
{ | ||
_json = json; | ||
} | ||
|
||
protected override void OnInit(params string[] arguments) | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<TargetFrameworks>net40;net45;netstandard2.0</TargetFrameworks> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<Version>3.0.1</Version> | ||
<Version>3.0.2</Version> | ||
<Authors>[email protected];</Authors> | ||
<AssemblyName>DotnetSpider.Extension</AssemblyName> | ||
<Copyright>Copyright 2018 Lewis Zou</Copyright> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Model": { | ||
"Selector": { | ||
"Type": "XPath", | ||
"Expression": "//div[@class='yk-pack pack-film']", | ||
"Arguments": null | ||
}, | ||
"Take": 0, | ||
"TakeFromHead": true, | ||
"Table": { | ||
"Database": "youku", | ||
"Name": "show", | ||
"Postfix": "Today", | ||
"UpdateColumns": null, | ||
"Indexs": null, | ||
"Uniques": null, | ||
"FullName": "show_2018_07_25" | ||
}, | ||
"Fields": [ | ||
{ | ||
"NotNull": false, | ||
"Option": "None", | ||
"Length": 255, | ||
"Name": "name", | ||
"IgnoreStore": false, | ||
"DataType": "String", | ||
"IsPrimary": false, | ||
"Formatters": null, | ||
"Type": "XPath", | ||
"Expression": ".//img[@class='quic']/@alt", | ||
"Arguments": null | ||
}, | ||
{ | ||
"NotNull": false, | ||
"Option": "None", | ||
"Length": 255, | ||
"Name": "index", | ||
"IgnoreStore": false, | ||
"DataType": "Int", | ||
"IsPrimary": false, | ||
"Formatters": null, | ||
"Type": "Enviroment", | ||
"Expression": "index", | ||
"Arguments": null | ||
}, | ||
{ | ||
"NotNull": false, | ||
"Option": "None", | ||
"Length": 255, | ||
"Name": "id", | ||
"IgnoreStore": false, | ||
"DataType": "Int", | ||
"IsPrimary": true, | ||
"Formatters": null, | ||
"Type": "Enviroment", | ||
"Expression": "", | ||
"Arguments": null | ||
} | ||
], | ||
"TargetRequestSelectors": [ | ||
{ | ||
"XPaths": [ "//ul[@class='yk-pages']" ], | ||
"Patterns": [ "(http|ftp|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?" ] | ||
} | ||
], | ||
"SharedValueSelectors": null | ||
}, | ||
"Scheduler": { | ||
"Name": "QueueDuplicateRemovedScheduler" | ||
}, | ||
"Downloader": { | ||
"Name": "HttpClientDownloader", | ||
"AllowAutoRedirect": true | ||
}, | ||
"Pipeline": { | ||
"Name": "MySqlEntityPipeline", | ||
"ConnectString": "Database='mysql';Data Source=localhost;password=;User ID=root;Port=3306;SslMode=None" | ||
}, | ||
"ClearSchedulerAfterCompleted": true, | ||
"StatusFlushInterval": 5000, | ||
"PipelineRetryTimes": 2, | ||
"PipelineCachedSize": 5, | ||
"RedialExecutor": "MutexRedialExecutor", | ||
"EmptySleepTime": 15000, | ||
"ExitWhenComplete": true, | ||
"ThreadNum": 1, | ||
"SkipTargetRequestsWhenResultIsEmpty": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<TargetFrameworks>net40;net45;netstandard2.0</TargetFrameworks> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<Version>3.0.0</Version> | ||
<Version>3.0.2</Version> | ||
<Authors>[email protected];</Authors> | ||
<AssemblyName>DotnetSpider.Extraction</AssemblyName> | ||
<Copyright>Copyright 2018 Lewis Zou</Copyright> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace DotnetSpider.Extraction.Model.Attribute | ||
{ | ||
|
3 changes: 2 additions & 1 deletion
3
src/DotnetSpider.Extraction/Model/Attribute/SharedValueSelector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace DotnetSpider.Extraction.Model.Attribute | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.