PimpAndHost Support Forums - #1 Image Hosting & Editing Site on the web!

PimpAndHost Support Forums - #1 Image Hosting & Editing Site on the web! (https://forum.pimpandhost.com/index.php)
-   Suggestions / Feedbacks (https://forum.pimpandhost.com/forumdisplay.php?f=4)
-   -   Automatic upload. (https://forum.pimpandhost.com/showthread.php?t=1191)

chipprell 01-29-2012 12:33 AM

Automatic upload.
 
Hello,
is there any way how can I automatically upload images to pimpandhost, by any script, external app, or anything else?

pimp 02-03-2012 08:07 PM

Automatically how? Give me example.

chipprell 02-18-2012 02:26 AM

Sorry for late response.

Well i have C# aplication what works with images. I need to upload images to pimp and host and get url for original image size, something like:
http://www.pimpandhost.com/image/14226799-original.html

I can get that url thats not problem with search, but i dont know how to upload images with C#, im not familiar with this flashuploader :{

Any hints?

korifeich 02-21-2012 04:08 AM

Here are my own function

public static string UploadImage(string imageLink, string imageSize)
{
string Link = "";
string command = "";

Post_Get login1 = new Post_Get("http://www.pimpandhost.com/upload/postUrl?req=%7B%22hash%22%3A%227582909469429%22%2C %22vall%22%3A%22" + imageLink + "%22%2C%22albumId%22%3A-1%7D");
try
{
Link = @login1.postGet();
}
catch (WebException ex)
{
return "bad";
}
StringBuilder sb = new StringBuilder(Link);
sb.Replace("\\/", "/");
Link = sb.ToString();
string pattern = @"http://www.pimpandhost.[a-z|/]+([0-9|a-z]+)";
Match Match = Regex.Match(Link, pattern);
Link = Match.Groups[1].ToString();
command = "http://www.pimpandhost.com/image/" + Link + "-original.html";
try
{
login1 = new Post_Get(command);
Link = @login1.postGet();
}
catch(WebException ex)
{
return "bad";
}
switch (imageSize)
{
case "original": pattern = "<input.+bb_codes_original.+.*"; break;
case "thumb": pattern = "<input.+bb_codes_thumb.+.*"; break;
case "small": pattern = "<input.+bb_codes_small.+.*"; break;
case "medium": pattern = "<input.+bb_codes_medium.+.*"; break;
}
Match = Regex.Match(Link, pattern);
Link = Match.ToString();
if (imageSize == "small" || imageSize == "thumb")
{
pattern = "http://.*jpg";
Match = Regex.Match(Link, pattern);
if (Match.ToString() == "")
{
pattern = "http://.*png";
Match = Regex.Match(Link, pattern);
}
Link = Match.ToString();
return "";
}
else
{
pattern = "http://i.*jpg";
Match = Regex.Match(Link, pattern);
if (Match.ToString() == "")
{
pattern = "http://i.*png";
Match = Regex.Match(Link, pattern);
}
Link = Match.ToString();
return "[IMG]" + Link + "[/IMG]";
}
}

Post_GEt is just modified get request

But this is Remote upload by the link.

chipprell 02-29-2012 01:36 AM

Thx, i will look at it later, gtg work now.


All times are GMT. The time now is 08:32 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
(c) www.Pimpandhost.com