Skip to content

Instantly share code, notes, and snippets.

@jamesaxl
Created January 3, 2015 21:41
Show Gist options
  • Save jamesaxl/016101c4b2f352ba67fe to your computer and use it in GitHub Desktop.
Save jamesaxl/016101c4b2f352ba67fe to your computer and use it in GitHub Desktop.
using System;
namespace PasteSharp
{
public abstract class PasteBin
{
public virtual void SendContentRequest(string content, string language, string expiry) {}
public virtual SendContentRequest(string content, string nick, string channel ,string summary)
public string GetUrlRequest { get; protected set;}
public string GetCententRequest { get; protected set;}
protected ISession Session;
public PasteBin() {
#if SOUP_SHARP
Session = new SoupSession();
#else
Session = new WebClientSession();
#endif
}
}
}
using System;
using System.Text.RegularExpressions;
namespace PasteSharp
{
public class Bpaste : PasteBin
{
public Bpaste () : base()
{
}
public override void SendContentRequest(string content, string language, string expiry) {
var match = Regex.Match(Session.Bpase (content, language, expiry), @"/raw/([0-9a-zA-Z]+)",RegexOptions.IgnoreCase);
if (match.Success) {
GetUrlRequest = "https://bpaste.net/show/" + match.Groups [1].Value;
}
}
}
}
using System;
using System.Text.RegularExpressions;
namespace PasteSharp
{
public class FpasteScsys : PasteBin
{
public override void SendContentRequest(string content, string nick, string channel ,string summary) {
var match = Regex.Match(Session.FpasteScsys( content, nick, channel , summary),
@"(http://fpaste.scsys.co.uk/[0-9a-zA-Z]+)",RegexOptions.IgnoreCase);
if (match.Success) {
GetUrlRequest = match.Groups [1].Value;
}
}
public FpasteScsys () : base()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment