[Owasp-o2-platform] Fwd: [New post] Testing using GitGub hosted images for WordPress.com blog posts

dinis cruz dinis.cruz at owasp.org
Sun Mar 18 06:30:12 UTC 2012

Next version of O2 has full Git support :)

Dinis Cruz

Begin forwarded message:

*From:* OWASP O2 Platform Blog <donotreply at wordpress.com>
*Date:* 18 March 2012 06:15:16 GMT
*To:* o2 at ddplus.net
*Subject:* *[New post] Testing using GitGub hosted images for
WordPress.comblog posts

      New post on *OWASP O2 Platform Blog*
<http://o2platform.wordpress.com/author/o2platform/>  Testing using GitGub
hosted images for WordPress.com blog
Dinis Cruz <http://o2platform.wordpress.com/author/o2platform/>

One of the things that has been a massive pain when writing these blog
posts has been the really bad workflow that WordPress.com has to deal with
image's uploads.

The workflow that I want is one where I can take a screenshot into my
local clipboard and 'automagically' that image is available to be inserted
in the blog (I'm happy to wait a coupe seconds as long as no other action
is needed).

In the past, I did come up with a 'semi automated way' to upload these
images via WordPressweb GUI (see O2 Script to automatically upload
clipboard images to
but it was not 100% stable and recently that O2 script stopped working
since WordPress.com changed its own image uploading code .

Since I'm now heavily into Git, and GitHub, I was thinking *'why don't I
copy the image from the clipboard into a local Git Repository, then push
that repository to the web, and expose the GitHub raw link available'*

And with the latest version of O2 (in .NET 4.0 + native .NET Git suport) I
was able to build such Gui.

*Here it is in action:*

After taking a screenshot, click on the *'Commit...'* link and eventually
the image will be shown in a WebBrowser and the image URL is also placed in
the clipboard (for example

Now to add an image to a blog post (like this one), one can use the url in
the clipboard, or just drag and drop the image from the WebBrowser:

*Here is the code that creates this GUI*

var topPanel = O2Gui.open("Util - Copy Clipboard Image to GitHub
//var topPanel = panel.clear().add_Panel();
var actionsPanel = topPanel.insert_Above(40, "Actions");
var url_TextBox = topPanel.insert_Above(20).add_Label("Image
var browser = topPanel.add_WebBrowser_Control();
var localRepository = @"C:\_WorkDir\O2\Images"
var nGit = new API_NGit();
actionsPanel.add_Link("Open Screenshot tool", ()=> API_Cropper.openGui())
            .append_Link("Commit image from clipboard and push",

                                var image =
                                if (image.notNull())
                                    var o2Timer = new O2Timer("upload
to Git").start();
                                    var url =
                                    "Current Status: {0}".info(nGit.status());

                                    "Url copied to Cliboard: {0}".info(url);

return nGit;


  *Dinis Cruz <http://o2platform.wordpress.com/author/o2platform/>* | March
18, 2012 at 6:15 am | Categories:
GitHub <http://o2platform.wordpress.com/?cat=5603054> | URL:

   See all comments<http://o2platform.wordpress.com/2012/03/18/testing-using-gitgub-hosted-images-for-wordpress-com-blog-posts/#comments>

     Unsubscribe or change your email settings at Manage

*Trouble clicking?* Copy and paste this URL into your browser:
         Thanks for flying with WordPress.com <http://wordpress.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.owasp.org/pipermail/owasp-o2-platform/attachments/20120318/de34e2f8/attachment.html>

More information about the Owasp-o2-platform mailing list