2013-11-03 23:53:49 +13:00
|
|
|
|
#region License Information (GPL v3)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
ShareX - A program that allows you to take screenshots and share any file type
|
2021-07-29 15:22:51 +12:00
|
|
|
|
Copyright (c) 2007-2021 ShareX Team
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#endregion License Information (GPL v3)
|
|
|
|
|
|
2014-12-11 09:25:20 +13:00
|
|
|
|
using ShareX.HelpersLib;
|
2016-06-28 05:20:55 +12:00
|
|
|
|
using ShareX.UploadersLib.Properties;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
using System.Collections.Generic;
|
2016-06-28 05:20:55 +12:00
|
|
|
|
using System.Drawing;
|
2014-09-26 14:56:41 +12:00
|
|
|
|
using System.Linq;
|
2016-05-01 19:54:11 +12:00
|
|
|
|
using System.Windows.Forms;
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2014-12-11 09:25:20 +13:00
|
|
|
|
namespace ShareX.UploadersLib.TextUploaders
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2016-03-22 11:51:37 +13:00
|
|
|
|
public class PastebinTextUploaderService : TextUploaderService
|
|
|
|
|
{
|
|
|
|
|
public override TextDestination EnumValue { get; } = TextDestination.Pastebin;
|
|
|
|
|
|
2016-06-28 05:20:55 +12:00
|
|
|
|
public override Icon ServiceIcon => Resources.Pastebin;
|
|
|
|
|
|
2016-03-24 07:47:59 +13:00
|
|
|
|
public override bool CheckConfig(UploadersConfig config) => true;
|
2016-03-23 05:28:55 +13:00
|
|
|
|
|
2016-04-04 21:53:11 +12:00
|
|
|
|
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
|
2016-03-22 11:51:37 +13:00
|
|
|
|
{
|
2016-03-24 07:47:59 +13:00
|
|
|
|
PastebinSettings settings = config.PastebinSettings;
|
2016-03-22 11:51:37 +13:00
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(settings.TextFormat))
|
|
|
|
|
{
|
2016-03-23 12:56:39 +13:00
|
|
|
|
settings.TextFormat = taskInfo.TextFormat;
|
2016-03-22 11:51:37 +13:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Pastebin(APIKeys.PastebinKey, settings);
|
|
|
|
|
}
|
2016-05-01 19:54:11 +12:00
|
|
|
|
|
|
|
|
|
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpPastebin;
|
2016-03-22 11:51:37 +13:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 23:53:49 +13:00
|
|
|
|
public sealed class Pastebin : TextUploader
|
|
|
|
|
{
|
|
|
|
|
private string APIKey;
|
|
|
|
|
|
|
|
|
|
public PastebinSettings Settings { get; private set; }
|
|
|
|
|
|
|
|
|
|
public Pastebin(string apiKey)
|
|
|
|
|
{
|
|
|
|
|
APIKey = apiKey;
|
|
|
|
|
Settings = new PastebinSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Pastebin(string apiKey, PastebinSettings settings)
|
|
|
|
|
{
|
|
|
|
|
APIKey = apiKey;
|
|
|
|
|
Settings = settings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Login()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(Settings.Username) && !string.IsNullOrEmpty(Settings.Password))
|
|
|
|
|
{
|
|
|
|
|
Dictionary<string, string> loginArgs = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
loginArgs.Add("api_dev_key", APIKey);
|
|
|
|
|
loginArgs.Add("api_user_name", Settings.Username);
|
|
|
|
|
loginArgs.Add("api_user_password", Settings.Password);
|
|
|
|
|
|
2017-04-01 08:09:14 +13:00
|
|
|
|
string loginResponse = SendRequestMultiPart("https://pastebin.com/api/api_login.php", loginArgs);
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(loginResponse) && !loginResponse.StartsWith("Bad API request"))
|
|
|
|
|
{
|
|
|
|
|
Settings.UserKey = loginResponse;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 21:33:29 +12:00
|
|
|
|
Settings.UserKey = null;
|
|
|
|
|
Errors.Add("Pastebin login failed.");
|
2013-11-03 23:53:49 +13:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override UploadResult UploadText(string text, string fileName)
|
|
|
|
|
{
|
|
|
|
|
UploadResult ur = new UploadResult();
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(text) && Settings != null)
|
|
|
|
|
{
|
|
|
|
|
Dictionary<string, string> args = new Dictionary<string, string>();
|
|
|
|
|
|
|
|
|
|
args.Add("api_dev_key", APIKey); // which is your unique API Developers Key
|
|
|
|
|
args.Add("api_option", "paste"); // set as 'paste', this will indicate you want to create a new paste
|
|
|
|
|
args.Add("api_paste_code", text); // this is the text that will be written inside your paste
|
|
|
|
|
|
|
|
|
|
// Optional args
|
|
|
|
|
args.Add("api_paste_name", Settings.Title); // this will be the name / title of your paste
|
|
|
|
|
args.Add("api_paste_format", Settings.TextFormat); // this will be the syntax highlighting value
|
2014-09-16 04:20:09 +12:00
|
|
|
|
args.Add("api_paste_private", GetPrivacy(Settings.Exposure)); // this makes a paste public or private, public = 0, private = 1
|
|
|
|
|
args.Add("api_paste_expire_date", GetExpiration(Settings.Expiration)); // this sets the expiration date of your paste
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Settings.UserKey))
|
|
|
|
|
{
|
|
|
|
|
args.Add("api_user_key", Settings.UserKey); // this paramater is part of the login system
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-01 08:09:14 +13:00
|
|
|
|
ur.Response = SendRequestMultiPart("https://pastebin.com/api/api_post.php", args);
|
2013-11-03 23:53:49 +13:00
|
|
|
|
|
2017-04-25 02:01:35 +12:00
|
|
|
|
if (URLHelpers.IsValidURL(ur.Response))
|
2013-11-03 23:53:49 +13:00
|
|
|
|
{
|
2016-03-19 01:08:24 +13:00
|
|
|
|
if (Settings.RawURL)
|
2016-03-18 23:46:55 +13:00
|
|
|
|
{
|
2017-04-01 08:09:14 +13:00
|
|
|
|
string id = URLHelpers.GetFileName(ur.Response);
|
|
|
|
|
ur.URL = "https://pastebin.com/raw/" + id;
|
2016-03-18 23:46:55 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ur.URL = ur.Response;
|
|
|
|
|
}
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Errors.Add(ur.Response);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ur;
|
|
|
|
|
}
|
2014-09-16 04:20:09 +12:00
|
|
|
|
|
|
|
|
|
private string GetPrivacy(PastebinPrivacy privacy)
|
|
|
|
|
{
|
|
|
|
|
switch (privacy)
|
|
|
|
|
{
|
|
|
|
|
case PastebinPrivacy.Public:
|
|
|
|
|
return "0";
|
|
|
|
|
default:
|
|
|
|
|
case PastebinPrivacy.Unlisted:
|
|
|
|
|
return "1";
|
|
|
|
|
case PastebinPrivacy.Private:
|
|
|
|
|
return "2";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetExpiration(PastebinExpiration expiration)
|
|
|
|
|
{
|
|
|
|
|
switch (expiration)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case PastebinExpiration.N:
|
|
|
|
|
return "N";
|
|
|
|
|
case PastebinExpiration.M10:
|
|
|
|
|
return "10M";
|
|
|
|
|
case PastebinExpiration.H1:
|
|
|
|
|
return "1H";
|
|
|
|
|
case PastebinExpiration.D1:
|
|
|
|
|
return "1D";
|
|
|
|
|
case PastebinExpiration.W1:
|
|
|
|
|
return "1W";
|
|
|
|
|
case PastebinExpiration.W2:
|
|
|
|
|
return "2W";
|
|
|
|
|
case PastebinExpiration.M1:
|
|
|
|
|
return "1M";
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-26 14:56:41 +12:00
|
|
|
|
|
|
|
|
|
public static List<PastebinSyntaxInfo> GetSyntaxList()
|
|
|
|
|
{
|
|
|
|
|
string syntaxList = @"4cs = 4CS
|
|
|
|
|
6502acme = 6502 ACME Cross Assembler
|
|
|
|
|
6502kickass = 6502 Kick Assembler
|
|
|
|
|
6502tasm = 6502 TASM/64TASS
|
|
|
|
|
abap = ABAP
|
|
|
|
|
actionscript = ActionScript
|
|
|
|
|
actionscript3 = ActionScript 3
|
|
|
|
|
ada = Ada
|
2016-03-18 23:46:55 +13:00
|
|
|
|
aimms = AIMMS
|
2014-09-26 14:56:41 +12:00
|
|
|
|
algol68 = ALGOL 68
|
|
|
|
|
apache = Apache Log
|
|
|
|
|
applescript = AppleScript
|
|
|
|
|
apt_sources = APT Sources
|
|
|
|
|
arm = ARM
|
|
|
|
|
asm = ASM (NASM)
|
|
|
|
|
asp = ASP
|
|
|
|
|
asymptote = Asymptote
|
|
|
|
|
autoconf = autoconf
|
|
|
|
|
autohotkey = Autohotkey
|
|
|
|
|
autoit = AutoIt
|
|
|
|
|
avisynth = Avisynth
|
|
|
|
|
awk = Awk
|
|
|
|
|
bascomavr = BASCOM AVR
|
|
|
|
|
bash = Bash
|
|
|
|
|
basic4gl = Basic4GL
|
2016-03-18 23:46:55 +13:00
|
|
|
|
dos = Batch
|
2014-09-26 14:56:41 +12:00
|
|
|
|
bibtex = BibTeX
|
|
|
|
|
blitzbasic = Blitz Basic
|
2016-03-18 23:46:55 +13:00
|
|
|
|
b3d = Blitz3D
|
|
|
|
|
bmx = BlitzMax
|
2014-09-26 14:56:41 +12:00
|
|
|
|
bnf = BNF
|
|
|
|
|
boo = BOO
|
|
|
|
|
bf = BrainFuck
|
|
|
|
|
c = C
|
2016-03-18 23:46:55 +13:00
|
|
|
|
c_winapi = C (WinAPI)
|
2014-09-26 14:56:41 +12:00
|
|
|
|
c_mac = C for Macs
|
|
|
|
|
cil = C Intermediate Language
|
|
|
|
|
csharp = C#
|
|
|
|
|
cpp = C++
|
2016-03-18 23:46:55 +13:00
|
|
|
|
cpp-winapi = C++ (WinAPI)
|
|
|
|
|
cpp-qt = C++ (with Qt extensions)
|
2014-09-26 14:56:41 +12:00
|
|
|
|
c_loadrunner = C: Loadrunner
|
|
|
|
|
caddcl = CAD DCL
|
|
|
|
|
cadlisp = CAD Lisp
|
2017-04-01 08:09:14 +13:00
|
|
|
|
ceylon = Ceylon
|
2014-09-26 14:56:41 +12:00
|
|
|
|
cfdg = CFDG
|
|
|
|
|
chaiscript = ChaiScript
|
2016-03-18 23:46:55 +13:00
|
|
|
|
chapel = Chapel
|
2014-09-26 14:56:41 +12:00
|
|
|
|
clojure = Clojure
|
|
|
|
|
klonec = Clone C
|
|
|
|
|
klonecpp = Clone C++
|
|
|
|
|
cmake = CMake
|
|
|
|
|
cobol = COBOL
|
|
|
|
|
coffeescript = CoffeeScript
|
|
|
|
|
cfm = ColdFusion
|
|
|
|
|
css = CSS
|
|
|
|
|
cuesheet = Cuesheet
|
|
|
|
|
d = D
|
2016-03-18 23:46:55 +13:00
|
|
|
|
dart = Dart
|
2014-09-26 14:56:41 +12:00
|
|
|
|
dcl = DCL
|
|
|
|
|
dcpu16 = DCPU-16
|
|
|
|
|
dcs = DCS
|
|
|
|
|
delphi = Delphi
|
|
|
|
|
oxygene = Delphi Prism (Oxygene)
|
|
|
|
|
diff = Diff
|
|
|
|
|
div = DIV
|
|
|
|
|
dot = DOT
|
|
|
|
|
e = E
|
2016-03-18 23:46:55 +13:00
|
|
|
|
ezt = Easytrieve
|
2014-09-26 14:56:41 +12:00
|
|
|
|
ecmascript = ECMAScript
|
|
|
|
|
eiffel = Eiffel
|
|
|
|
|
email = Email
|
|
|
|
|
epc = EPC
|
|
|
|
|
erlang = Erlang
|
2017-04-01 08:09:14 +13:00
|
|
|
|
euphoria = Euphoria
|
2014-09-26 14:56:41 +12:00
|
|
|
|
fsharp = F#
|
|
|
|
|
falcon = Falcon
|
2017-04-01 08:09:14 +13:00
|
|
|
|
filemaker = Filemaker
|
2014-09-26 14:56:41 +12:00
|
|
|
|
fo = FO Language
|
|
|
|
|
f1 = Formula One
|
|
|
|
|
fortran = Fortran
|
|
|
|
|
freebasic = FreeBasic
|
|
|
|
|
freeswitch = FreeSWITCH
|
|
|
|
|
gambas = GAMBAS
|
|
|
|
|
gml = Game Maker
|
|
|
|
|
gdb = GDB
|
|
|
|
|
genero = Genero
|
|
|
|
|
genie = Genie
|
|
|
|
|
gettext = GetText
|
|
|
|
|
go = Go
|
|
|
|
|
groovy = Groovy
|
|
|
|
|
gwbasic = GwBasic
|
|
|
|
|
haskell = Haskell
|
|
|
|
|
haxe = Haxe
|
|
|
|
|
hicest = HicEst
|
|
|
|
|
hq9plus = HQ9 Plus
|
|
|
|
|
html4strict = HTML
|
|
|
|
|
html5 = HTML 5
|
|
|
|
|
icon = Icon
|
|
|
|
|
idl = IDL
|
|
|
|
|
ini = INI file
|
|
|
|
|
inno = Inno Script
|
|
|
|
|
intercal = INTERCAL
|
|
|
|
|
io = IO
|
2016-03-18 23:46:55 +13:00
|
|
|
|
ispfpanel = ISPF Panel Definition
|
2014-09-26 14:56:41 +12:00
|
|
|
|
j = J
|
|
|
|
|
java = Java
|
|
|
|
|
java5 = Java 5
|
|
|
|
|
javascript = JavaScript
|
2016-03-18 23:46:55 +13:00
|
|
|
|
jcl = JCL
|
2014-09-26 14:56:41 +12:00
|
|
|
|
jquery = jQuery
|
2016-03-18 23:46:55 +13:00
|
|
|
|
json = JSON
|
|
|
|
|
julia = Julia
|
2014-09-26 14:56:41 +12:00
|
|
|
|
kixtart = KiXtart
|
2017-04-01 08:09:14 +13:00
|
|
|
|
kotlin = Kotlin
|
2014-09-26 14:56:41 +12:00
|
|
|
|
latex = Latex
|
|
|
|
|
ldif = LDIF
|
|
|
|
|
lb = Liberty BASIC
|
|
|
|
|
lsl2 = Linden Scripting
|
|
|
|
|
lisp = Lisp
|
|
|
|
|
llvm = LLVM
|
|
|
|
|
locobasic = Loco Basic
|
|
|
|
|
logtalk = Logtalk
|
|
|
|
|
lolcode = LOL Code
|
|
|
|
|
lotusformulas = Lotus Formulas
|
|
|
|
|
lotusscript = Lotus Script
|
|
|
|
|
lscript = LScript
|
|
|
|
|
lua = Lua
|
|
|
|
|
m68k = M68000 Assembler
|
|
|
|
|
magiksf = MagikSF
|
|
|
|
|
make = Make
|
|
|
|
|
mapbasic = MapBasic
|
2017-04-01 08:09:14 +13:00
|
|
|
|
markdown = Markdown
|
2014-09-26 14:56:41 +12:00
|
|
|
|
matlab = MatLab
|
|
|
|
|
mirc = mIRC
|
|
|
|
|
mmix = MIX Assembler
|
|
|
|
|
modula2 = Modula 2
|
|
|
|
|
modula3 = Modula 3
|
|
|
|
|
68000devpac = Motorola 68000 HiSoft Dev
|
|
|
|
|
mpasm = MPASM
|
|
|
|
|
mxml = MXML
|
|
|
|
|
mysql = MySQL
|
|
|
|
|
nagios = Nagios
|
2016-03-18 23:46:55 +13:00
|
|
|
|
netrexx = NetRexx
|
2014-09-26 14:56:41 +12:00
|
|
|
|
newlisp = newLISP
|
2016-03-18 23:46:55 +13:00
|
|
|
|
nginx = Nginx
|
|
|
|
|
nimrod = Nimrod
|
2014-09-26 14:56:41 +12:00
|
|
|
|
nsis = NullSoft Installer
|
|
|
|
|
oberon2 = Oberon 2
|
|
|
|
|
objeck = Objeck Programming Langua
|
|
|
|
|
objc = Objective C
|
|
|
|
|
ocaml-brief = OCalm Brief
|
|
|
|
|
ocaml = OCaml
|
|
|
|
|
octave = Octave
|
2017-04-01 08:09:14 +13:00
|
|
|
|
oorexx = Open Object Rexx
|
2014-09-26 14:56:41 +12:00
|
|
|
|
pf = OpenBSD PACKET FILTER
|
|
|
|
|
glsl = OpenGL Shading
|
|
|
|
|
oobas = Openoffice BASIC
|
|
|
|
|
oracle11 = Oracle 11
|
|
|
|
|
oracle8 = Oracle 8
|
|
|
|
|
oz = Oz
|
|
|
|
|
parasail = ParaSail
|
|
|
|
|
parigp = PARI/GP
|
|
|
|
|
pascal = Pascal
|
2016-03-18 23:46:55 +13:00
|
|
|
|
pawn = Pawn
|
2014-09-26 14:56:41 +12:00
|
|
|
|
pcre = PCRE
|
|
|
|
|
per = Per
|
|
|
|
|
perl = Perl
|
|
|
|
|
perl6 = Perl 6
|
|
|
|
|
php = PHP
|
|
|
|
|
php-brief = PHP Brief
|
|
|
|
|
pic16 = Pic 16
|
|
|
|
|
pike = Pike
|
|
|
|
|
pixelbender = Pixel Bender
|
2017-04-01 08:09:14 +13:00
|
|
|
|
pli = PL/I
|
2014-09-26 14:56:41 +12:00
|
|
|
|
plsql = PL/SQL
|
|
|
|
|
postgresql = PostgreSQL
|
2016-03-18 23:46:55 +13:00
|
|
|
|
postscript = PostScript
|
2014-09-26 14:56:41 +12:00
|
|
|
|
povray = POV-Ray
|
|
|
|
|
powershell = Power Shell
|
|
|
|
|
powerbuilder = PowerBuilder
|
|
|
|
|
proftpd = ProFTPd
|
|
|
|
|
progress = Progress
|
|
|
|
|
prolog = Prolog
|
|
|
|
|
properties = Properties
|
|
|
|
|
providex = ProvideX
|
2016-03-18 23:46:55 +13:00
|
|
|
|
puppet = Puppet
|
2014-09-26 14:56:41 +12:00
|
|
|
|
purebasic = PureBasic
|
|
|
|
|
pycon = PyCon
|
|
|
|
|
python = Python
|
|
|
|
|
pys60 = Python for S60
|
|
|
|
|
q = q/kdb+
|
|
|
|
|
qbasic = QBasic
|
2016-03-18 23:46:55 +13:00
|
|
|
|
qml = QML
|
2014-09-26 14:56:41 +12:00
|
|
|
|
rsplus = R
|
2016-03-18 23:46:55 +13:00
|
|
|
|
racket = Racket
|
2014-09-26 14:56:41 +12:00
|
|
|
|
rails = Rails
|
2016-03-18 23:46:55 +13:00
|
|
|
|
rbs = RBScript
|
2014-09-26 14:56:41 +12:00
|
|
|
|
rebol = REBOL
|
|
|
|
|
reg = REG
|
|
|
|
|
rexx = Rexx
|
|
|
|
|
robots = Robots
|
|
|
|
|
rpmspec = RPM Spec
|
|
|
|
|
ruby = Ruby
|
|
|
|
|
gnuplot = Ruby Gnuplot
|
2016-03-18 23:46:55 +13:00
|
|
|
|
rust = Rust
|
2014-09-26 14:56:41 +12:00
|
|
|
|
sas = SAS
|
|
|
|
|
scala = Scala
|
|
|
|
|
scheme = Scheme
|
|
|
|
|
scilab = Scilab
|
2016-03-18 23:46:55 +13:00
|
|
|
|
scl = SCL
|
2014-09-26 14:56:41 +12:00
|
|
|
|
sdlbasic = SdlBasic
|
|
|
|
|
smalltalk = Smalltalk
|
|
|
|
|
smarty = Smarty
|
|
|
|
|
spark = SPARK
|
|
|
|
|
sparql = SPARQL
|
2016-03-18 23:46:55 +13:00
|
|
|
|
sqf = SQF
|
2014-09-26 14:56:41 +12:00
|
|
|
|
sql = SQL
|
2016-03-18 23:46:55 +13:00
|
|
|
|
standardml = StandardML
|
2014-09-26 14:56:41 +12:00
|
|
|
|
stonescript = StoneScript
|
2016-03-18 23:46:55 +13:00
|
|
|
|
sclang = SuperCollider
|
|
|
|
|
swift = Swift
|
2014-09-26 14:56:41 +12:00
|
|
|
|
systemverilog = SystemVerilog
|
|
|
|
|
tsql = T-SQL
|
|
|
|
|
tcl = TCL
|
|
|
|
|
teraterm = Tera Term
|
|
|
|
|
thinbasic = thinBasic
|
|
|
|
|
typoscript = TypoScript
|
|
|
|
|
unicon = Unicon
|
|
|
|
|
uscript = UnrealScript
|
2017-04-01 08:09:14 +13:00
|
|
|
|
upc = UPC
|
2014-09-26 14:56:41 +12:00
|
|
|
|
urbi = Urbi
|
|
|
|
|
vala = Vala
|
|
|
|
|
vbnet = VB.NET
|
2016-03-18 23:46:55 +13:00
|
|
|
|
vbscript = VBScript
|
2014-09-26 14:56:41 +12:00
|
|
|
|
vedit = Vedit
|
|
|
|
|
verilog = VeriLog
|
|
|
|
|
vhdl = VHDL
|
|
|
|
|
vim = VIM
|
|
|
|
|
visualprolog = Visual Pro Log
|
|
|
|
|
vb = VisualBasic
|
|
|
|
|
visualfoxpro = VisualFoxPro
|
|
|
|
|
whitespace = WhiteSpace
|
|
|
|
|
whois = WHOIS
|
|
|
|
|
winbatch = Winbatch
|
|
|
|
|
xbasic = XBasic
|
|
|
|
|
xml = XML
|
|
|
|
|
xorg_conf = Xorg Config
|
|
|
|
|
xpp = XPP
|
|
|
|
|
yaml = YAML
|
|
|
|
|
z80 = Z80 Assembler
|
|
|
|
|
zxbasic = ZXBasic";
|
|
|
|
|
|
|
|
|
|
List<PastebinSyntaxInfo> result = new List<PastebinSyntaxInfo>();
|
|
|
|
|
result.Add(new PastebinSyntaxInfo("None", "text"));
|
|
|
|
|
|
|
|
|
|
foreach (string line in syntaxList.Lines().Select(x => x.Trim()))
|
|
|
|
|
{
|
|
|
|
|
int index = line.IndexOf('=');
|
2016-03-18 23:46:55 +13:00
|
|
|
|
|
2014-09-26 14:56:41 +12:00
|
|
|
|
if (index > 0)
|
|
|
|
|
{
|
|
|
|
|
PastebinSyntaxInfo syntaxInfo = new PastebinSyntaxInfo();
|
|
|
|
|
syntaxInfo.Value = line.Remove(index).Trim();
|
|
|
|
|
syntaxInfo.Name = line.Substring(index + 1).Trim();
|
|
|
|
|
result.Add(syntaxInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2014-09-16 04:20:09 +12:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-01 18:05:53 +13:00
|
|
|
|
public enum PastebinPrivacy // Localized
|
2014-09-16 04:20:09 +12:00
|
|
|
|
{
|
|
|
|
|
Public,
|
|
|
|
|
Unlisted,
|
|
|
|
|
Private
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-01 18:05:53 +13:00
|
|
|
|
public enum PastebinExpiration // Localized
|
2014-09-16 04:20:09 +12:00
|
|
|
|
{
|
|
|
|
|
N,
|
|
|
|
|
M10,
|
|
|
|
|
H1,
|
|
|
|
|
D1,
|
|
|
|
|
W1,
|
|
|
|
|
W2,
|
|
|
|
|
M1
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-26 14:56:41 +12:00
|
|
|
|
public class PastebinSyntaxInfo
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
|
|
|
|
|
public PastebinSyntaxInfo()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PastebinSyntaxInfo(string name, string value)
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Value = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 23:53:49 +13:00
|
|
|
|
public class PastebinSettings
|
|
|
|
|
{
|
2014-05-30 23:38:23 +12:00
|
|
|
|
public string Username { get; set; }
|
2020-06-01 12:16:18 +12:00
|
|
|
|
[JsonEncrypt]
|
2014-05-30 23:38:23 +12:00
|
|
|
|
public string Password { get; set; }
|
2016-03-18 23:46:55 +13:00
|
|
|
|
public PastebinPrivacy Exposure { get; set; } = PastebinPrivacy.Unlisted;
|
|
|
|
|
public PastebinExpiration Expiration { get; set; } = PastebinExpiration.N;
|
2014-05-30 23:38:23 +12:00
|
|
|
|
public string Title { get; set; }
|
2016-03-18 23:46:55 +13:00
|
|
|
|
public string TextFormat { get; set; } = "text";
|
2020-06-01 12:16:18 +12:00
|
|
|
|
[JsonEncrypt]
|
2013-11-03 23:53:49 +13:00
|
|
|
|
public string UserKey { get; set; }
|
2016-03-19 01:08:24 +13:00
|
|
|
|
public bool RawURL { get; set; }
|
2013-11-03 23:53:49 +13:00
|
|
|
|
}
|
|
|
|
|
}
|