Created
January 3, 2015 21:41
-
-
Save jamesaxl/016101c4b2f352ba67fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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 | |
} | |
} | |
} |
This file contains hidden or 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
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; | |
} | |
} | |
} | |
} |
This file contains hidden or 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
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