C# / .NET library for fetching Bitcointalk.org boards, topics and posts.
- Fetch topics from board pages and posts from topic pages or the "Recent Posts" page.
- Get post's message*, URL, title, number in topic, creation date, author's username and profile link.
- Quickly fetch post messages from the entire topic (other data will require additional fetching).
- Fully commented code for developing extensions / different versions.
* The message is stripped of [code] fields, quotes, images, links (as in href'ed URLs), smileys (replaced with a selected string) and new lines / line breaks. Feel free to create your own modification.
/*
using BitcointalkAPI;
using BitcointalkAPI.Utilities;
using System;
using System.Collections.Generic;
...
*/
Topic newTopic = new Topic(@"https://bitcointalk.org/index.php?topic=1.0", new WebConfig(2000));
ICollection<Post> posts = newTopic.GetPosts(1);
foreach (Post post in posts)
{
Console.WriteLine(post.Message);
}
/*
using BitcointalkAPI;
using BitcointalkAPI.Utilities;
using System;
using System.Collections.Generic;
...
*/
Board board = new Board(@"https://bitcointalk.org/index.php?board=1.0", new WebConfig(2000));
ICollection<Topic> allTopics = board.GetTopics(1, 5);
foreach (Topic topic in allTopics)
{
Console.WriteLine(topic.Link);
}
- Download the latest version of the DLLs from the Binaries folder;
- Open up the project you want to use the library for in Microsoft Visual Studio;
- Add the libraries to your project's "References":
- In Visual Studio Community 2015:
- Open up the "Solution Explorer";
- Go to "Solution '[Your solution name]'" > "[Project name]";
- Right click on "References" and click "Add references...";
- Select the "Browse" tab and click the "Browse..." button;
- Navigate to the "BitcointalkAPI.dll" file and select it;
- Click "OK".
- (Optional) Include the "using BitcointalkAPI;" and "using BitcointalkAPI.Utilities;" lines in every source file you use the library in for easier access.
OR
- Clone or download the project's repository;
- Open up the "BitcointalkAPI.sln" project file with Microsoft Visual Studio Community 2015 (or any other compatible Visual Studio version);
- Go to "Project" > "Manage NuGet Packages...";
- Redownload and reinstall the missing "HTML Agility Pack" package (Visual Studio should prompt you to do so);
- Make sure the "Release" configuration is selected (at the top; near the "Start button");
- Build the solution ("Build" > "Build Solution");
- Follow the previous instructions from step 2.
- HTML Agility Pack (license: MS-PL);
- .NET Framework 4.6.1 (may work with an older version, though untested).
The project's files (except for the ones belonging to the HTML Agility Pack (HTMLAgilityPack.dll and HTMLAgilityPack.xml) in the Binaries folder and subfolders) are licensed under the AGPL 3.0 license.
v0.5 - initial release.
Donations are welcome: 1mprepxqZeK7LcRYEz84DVJKCvF8CQ8gu