Skip to content

mprep-btc/Unofficial-Bitcointalk-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial Bitcointalk API

C# / .NET library for fetching Bitcointalk.org boards, topics and posts.

Features

  • 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.

Usage examples

Print out all posts from a single topic page

/*
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);
}

Print out all topic links from the first 5 board pages (fetching board pages with a 2 second delay)

/*
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);
}

Installation instructions

  1. Download the latest version of the DLLs from the Binaries folder;
  2. Open up the project you want to use the library for in Microsoft Visual Studio;
  3. 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".
  1. (Optional) Include the "using BitcointalkAPI;" and "using BitcointalkAPI.Utilities;" lines in every source file you use the library in for easier access.

OR

  1. Clone or download the project's repository;
  2. Open up the "BitcointalkAPI.sln" project file with Microsoft Visual Studio Community 2015 (or any other compatible Visual Studio version);
  3. Go to "Project" > "Manage NuGet Packages...";
  4. Redownload and reinstall the missing "HTML Agility Pack" package (Visual Studio should prompt you to do so);
  5. Make sure the "Release" configuration is selected (at the top; near the "Start button");
  6. Build the solution ("Build" > "Build Solution");
  7. Follow the previous instructions from step 2.

Dependancies

License

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.

Major changes

v0.5 - initial release.

Donations

Donations are welcome: 1mprepxqZeK7LcRYEz84DVJKCvF8CQ8gu

About

Unofficial C# / .NET library for fetching Bitcointalk.org boards, topics and posts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages