~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to ImageShack/src/ImageShackAction.cs

  • Committer: David Siegel
  • Date: 2008-11-14 18:59:50 UTC
  • mfrom: (264.1.3 do-plugins)
  • Revision ID: david@david-desktop-20081114185950-tyvcga7oowbrkf9s
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
namespace ImageShack
34
34
{
35
 
        public class ImageShackAction : AbstractAction
 
35
        public class ImageShackAction : AbstractAction, IConfigurable
36
36
        {
37
37
                public override string Name
38
38
                {
67
67
                        }
68
68
                        return false;
69
69
                }
70
 
                                
 
70
                        
 
71
                public Gtk.Bin GetConfiguration ()
 
72
                {
 
73
                        return new ImageShackConfig();
 
74
                }
 
75
                
71
76
                public override IItem[] Perform (IItem[] items, IItem[] modifierItems)
72
77
                {                                                               
73
78
                        try {
124
129
                        HttpWebRequest request = (HttpWebRequest) WebRequest.Create ("http://www.imageshack.us/index.php");
125
130
                        request.Method = "POST";
126
131
                        request.ContentType = "multipart/form-data ; boundary=" + boundary;
 
132
                        
 
133
                        if (!String.IsNullOrEmpty (ImageShackConfig.RegistrationCode)) {
 
134
                                request.CookieContainer = new CookieContainer ();
 
135
                                Cookie imageshackCookie = new Cookie ("myimages", ImageShackConfig.RegistrationCode, "/", ".imageshack.us");
 
136
                                request.CookieContainer.Add (imageshackCookie);
 
137
                        }
127
138
 
128
139
            StringBuilder sb = new StringBuilder ();
129
140
            sb.Append ("--");