bas.Blogmarks.MarkClient? C# Client

A C# Client to the blogmarks.net Atom API

Regard this library as a sample to use the blogmarks.net Atom Api. While this Api may change at any time, this code needs to be updated.

Public Methods

  • public MarkEntry addMark(MarkEntry entry)
  • public MarkEntry updateMark(MarkEntry entry)
  • public bool deleteMark(int id)
  • public MarkEntry getMark(int id)
  • public MarkEntry getLastMark()

A MarkEntry is an object with the following properties :

  • title string (required)
  • link string (required)
  • summary string
  • isPrivate boolean (default false)
  • categories string array
  • via string

Sample (see Class1.cs)

string username = "killi";
string password = "xxxxx";

MarkClient bmc = new MarkClient(username, password);


// Adding a new mark
MarkEntry newm = new MarkEntry();
newm.title = "Killifishes";
newm.link =  "http://www.peixebom.com.br/Killies/killies.htm";
newm.isPrivate = true;
newm.via = "http://www.google.com/?q=Killies";

MarkEntry result = bmc.addMark(newm);
if (result == null) {
	Console.WriteLine("Error : " + bmc.lastError);
	return;
}
Console.WriteLine("Your entry \"" + result.title + "\" was posted to Blogmarks.net!");


// Getting the new mark
MarkEntry lastm = bmc.getLastMark();
if (lastm == null) {
	Console.WriteLine("Error : " + bmc.lastError);
	return;
}
Console.WriteLine("Your last entry is \"" + lastm.title + "\".");


// Updating the last mark with tags and new description
lastm.summary = "very interesting site !";
lastm.categories = new string[] {"test", "nyfiken", "i love fishes"};
result = bmc.updateMark(lastm);
if (result == null) {
	Console.WriteLine("Error : " + bmc.lastError);
	return;
}
Console.WriteLine("Blogmarks.net has updated this \"" + result.summary + "\"");


// Deleting the mark
Console.Write("Hit <enter> to delete last mark...");
Console.ReadLine();
bool gone = bmc.deleteMark(lastm.entryId);
if (gone == false) {
	Console.WriteLine("Error : " + bmc.lastError);
	return;
}
Console.WriteLine("Your last mark has gone");

Visual Studio 2003 solution

  • Library : bas.Blogmarks project
  • Sample : Sample project

Manual builds

  • Library : csc -t:library -out:bas.Blogmarks.dll Mark*.cs
  • Sample : csc -r:bas.Blogmarks.dll -target:exe -out:Class1.exe Class1.cs

Issues

Credits

Attachments