Added Hızlı Resim image uploader

This commit is contained in:
Jaex 2014-09-30 16:32:39 +03:00
parent b14a0611cc
commit 96f6dd9e7b
5 changed files with 114 additions and 47 deletions

View file

@ -189,16 +189,16 @@ private void InitializeComponent()
this.tsmiTrayWorkflows = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayTools = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayScreenColorPicker = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayRuler = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayFTPClient = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayHashCheck = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayIndexFolder = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayImageEditor = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayImageEffects = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayMonitorTest = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayHashCheck = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayDNSChanger = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayQRCode = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayIndexFolder = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayRuler = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayFTPClient = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayTweetMessage = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayMonitorTest = new System.Windows.Forms.ToolStripMenuItem();
this.tssTray1 = new System.Windows.Forms.ToolStripSeparator();
this.tsmiTrayAfterCaptureTasks = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTrayAfterUploadTasks = new System.Windows.Forms.ToolStripMenuItem();
@ -407,7 +407,7 @@ private void InitializeComponent()
//
// tsmiScreenRecordingFFmpeg
//
this.tsmiScreenRecordingFFmpeg.Image = global::ShareX.Properties.Resources.film;
this.tsmiScreenRecordingFFmpeg.Image = global::ShareX.Properties.Resources.camcorder_image;
this.tsmiScreenRecordingFFmpeg.Name = "tsmiScreenRecordingFFmpeg";
this.tsmiScreenRecordingFFmpeg.Size = new System.Drawing.Size(217, 22);
this.tsmiScreenRecordingFFmpeg.Text = "Screen recording (FFmpeg)";
@ -415,7 +415,7 @@ private void InitializeComponent()
//
// tsmiScreenRecordingGIF
//
this.tsmiScreenRecordingGIF.Image = global::ShareX.Properties.Resources.camcorder_image;
this.tsmiScreenRecordingGIF.Image = global::ShareX.Properties.Resources.film;
this.tsmiScreenRecordingGIF.Name = "tsmiScreenRecordingGIF";
this.tsmiScreenRecordingGIF.Size = new System.Drawing.Size(217, 22);
this.tsmiScreenRecordingGIF.Text = "Screen recording (GIF)";
@ -1580,7 +1580,7 @@ private void InitializeComponent()
//
// screenRecordingFFmpegToolStripMenuItem
//
this.screenRecordingFFmpegToolStripMenuItem.Image = global::ShareX.Properties.Resources.film;
this.screenRecordingFFmpegToolStripMenuItem.Image = global::ShareX.Properties.Resources.camcorder_image;
this.screenRecordingFFmpegToolStripMenuItem.Name = "screenRecordingFFmpegToolStripMenuItem";
this.screenRecordingFFmpegToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
this.screenRecordingFFmpegToolStripMenuItem.Text = "Screen recording (FFmpeg)";
@ -1588,7 +1588,7 @@ private void InitializeComponent()
//
// tsmiTrayScreenRecordingGIF
//
this.tsmiTrayScreenRecordingGIF.Image = global::ShareX.Properties.Resources.camcorder_image;
this.tsmiTrayScreenRecordingGIF.Image = global::ShareX.Properties.Resources.film;
this.tsmiTrayScreenRecordingGIF.Name = "tsmiTrayScreenRecordingGIF";
this.tsmiTrayScreenRecordingGIF.Size = new System.Drawing.Size(217, 22);
this.tsmiTrayScreenRecordingGIF.Text = "Screen recording (GIF)";
@ -1689,38 +1689,6 @@ private void InitializeComponent()
this.tsmiTrayScreenColorPicker.Text = "Screen color picker...";
this.tsmiTrayScreenColorPicker.Click += new System.EventHandler(this.tsmiCursorHelper_Click);
//
// tsmiTrayRuler
//
this.tsmiTrayRuler.Image = global::ShareX.Properties.Resources.ruler_triangle;
this.tsmiTrayRuler.Name = "tsmiTrayRuler";
this.tsmiTrayRuler.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayRuler.Text = "Ruler...";
this.tsmiTrayRuler.Click += new System.EventHandler(this.tsmiRuler_Click);
//
// tsmiTrayFTPClient
//
this.tsmiTrayFTPClient.Image = global::ShareX.Properties.Resources.application_network;
this.tsmiTrayFTPClient.Name = "tsmiTrayFTPClient";
this.tsmiTrayFTPClient.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayFTPClient.Text = "FTP client...";
this.tsmiTrayFTPClient.Click += new System.EventHandler(this.tsmiFTPClient_Click);
//
// tsmiTrayHashCheck
//
this.tsmiTrayHashCheck.Image = global::ShareX.Properties.Resources.application_task;
this.tsmiTrayHashCheck.Name = "tsmiTrayHashCheck";
this.tsmiTrayHashCheck.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayHashCheck.Text = "Hash check...";
this.tsmiTrayHashCheck.Click += new System.EventHandler(this.tsmiHashCheck_Click);
//
// tsmiTrayIndexFolder
//
this.tsmiTrayIndexFolder.Image = global::ShareX.Properties.Resources.folder_tree;
this.tsmiTrayIndexFolder.Name = "tsmiTrayIndexFolder";
this.tsmiTrayIndexFolder.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayIndexFolder.Text = "Index folder...";
this.tsmiTrayIndexFolder.Click += new System.EventHandler(this.tsmiIndexFolder_Click);
//
// tsmiTrayImageEditor
//
this.tsmiTrayImageEditor.Image = global::ShareX.Properties.Resources.image_pencil;
@ -1737,13 +1705,13 @@ private void InitializeComponent()
this.tsmiTrayImageEffects.Text = "Image effects...";
this.tsmiTrayImageEffects.Click += new System.EventHandler(this.tsmiImageEffects_Click);
//
// tsmiTrayMonitorTest
// tsmiTrayHashCheck
//
this.tsmiTrayMonitorTest.Image = global::ShareX.Properties.Resources.monitor;
this.tsmiTrayMonitorTest.Name = "tsmiTrayMonitorTest";
this.tsmiTrayMonitorTest.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayMonitorTest.Text = "Monitor test...";
this.tsmiTrayMonitorTest.Click += new System.EventHandler(this.tsmiMonitorTest_Click);
this.tsmiTrayHashCheck.Image = global::ShareX.Properties.Resources.application_task;
this.tsmiTrayHashCheck.Name = "tsmiTrayHashCheck";
this.tsmiTrayHashCheck.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayHashCheck.Text = "Hash check...";
this.tsmiTrayHashCheck.Click += new System.EventHandler(this.tsmiHashCheck_Click);
//
// tsmiTrayDNSChanger
//
@ -1761,6 +1729,30 @@ private void InitializeComponent()
this.tsmiTrayQRCode.Text = "QR code...";
this.tsmiTrayQRCode.Click += new System.EventHandler(this.tsmiQRCode_Click);
//
// tsmiTrayIndexFolder
//
this.tsmiTrayIndexFolder.Image = global::ShareX.Properties.Resources.folder_tree;
this.tsmiTrayIndexFolder.Name = "tsmiTrayIndexFolder";
this.tsmiTrayIndexFolder.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayIndexFolder.Text = "Index folder...";
this.tsmiTrayIndexFolder.Click += new System.EventHandler(this.tsmiIndexFolder_Click);
//
// tsmiTrayRuler
//
this.tsmiTrayRuler.Image = global::ShareX.Properties.Resources.ruler_triangle;
this.tsmiTrayRuler.Name = "tsmiTrayRuler";
this.tsmiTrayRuler.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayRuler.Text = "Ruler...";
this.tsmiTrayRuler.Click += new System.EventHandler(this.tsmiRuler_Click);
//
// tsmiTrayFTPClient
//
this.tsmiTrayFTPClient.Image = global::ShareX.Properties.Resources.application_network;
this.tsmiTrayFTPClient.Name = "tsmiTrayFTPClient";
this.tsmiTrayFTPClient.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayFTPClient.Text = "FTP client...";
this.tsmiTrayFTPClient.Click += new System.EventHandler(this.tsmiFTPClient_Click);
//
// tsmiTrayTweetMessage
//
this.tsmiTrayTweetMessage.Image = global::ShareX.Properties.Resources.Twitter;
@ -1769,6 +1761,14 @@ private void InitializeComponent()
this.tsmiTrayTweetMessage.Text = "Tweet message...";
this.tsmiTrayTweetMessage.Click += new System.EventHandler(this.tsmiTweetMessage_Click);
//
// tsmiTrayMonitorTest
//
this.tsmiTrayMonitorTest.Image = global::ShareX.Properties.Resources.monitor;
this.tsmiTrayMonitorTest.Name = "tsmiTrayMonitorTest";
this.tsmiTrayMonitorTest.Size = new System.Drawing.Size(183, 22);
this.tsmiTrayMonitorTest.Text = "Monitor test...";
this.tsmiTrayMonitorTest.Click += new System.EventHandler(this.tsmiMonitorTest_Click);
//
// tssTray1
//
this.tssTray1.Name = "tssTray1";

View file

@ -709,6 +709,12 @@ public UploadResult UploadImage(Stream stream, string fileName)
DirectURL = Program.UploadersConfig.CheveretoDirectURL
};
break;
case ImageDestination.HizliResim:
imageUploader = new HizliResim()
{
DirectURL = true
};
break;
case ImageDestination.CustomImageUploader:
if (Program.UploadersConfig.CustomUploadersList.IsValidIndex(Program.UploadersConfig.CustomImageUploaderSelected))
{

View file

@ -46,6 +46,8 @@ public enum ImageDestination
Twitter,
[Description("Chevereto")]
Chevereto,
[Description("Hızlı Resim")]
HizliResim,
[Description("Custom image uploader")]
CustomImageUploader,
[Description("File uploader")]

View file

@ -0,0 +1,58 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (C) 2007-2014 ShareX Developers
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)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace UploadersLib.ImageUploaders
{
public sealed class HizliResim : ImageUploader
{
public bool DirectURL { get; set; }
public override UploadResult Upload(Stream stream, string fileName)
{
UploadResult result = UploadData(stream, "http://hizliresim.com/upload.php", fileName, "local_files[]");
if (result.IsSuccess)
{
string id = DirectURL ? "link-direct" : "link-web";
Match match = Regex.Match(result.Response, string.Format("id={0}.+?value=\"(.+)\">", id));
if (match.Success)
{
result.URL = match.Groups[1].Value;
}
}
return result;
}
}
}

View file

@ -183,6 +183,7 @@
<Compile Include="FileUploaders\GfycatUploader.cs" />
<Compile Include="HelperClasses\OAuth\IOAuthBase.cs" />
<Compile Include="ImageUploaders\Chevereto.cs" />
<Compile Include="ImageUploaders\HizliResim.cs" />
<Compile Include="TextUploaders\Hastebin.cs" />
<Compile Include="TextUploaders\Upaste.cs" />
<Compile Include="UploadersConfig.cs" />