Login to WordPress from Python

I've been trying to learn some Python and have been tinkering with the requests module. Here is how I am able to log into a webpage, such as WordPress. import requests url = "https://techish.net/wp-login.php" redirect_to = "https://techish.net/wp-admin/" with requests.Session() as session: post = session.post(url, data={ … [Read more...]

Forgotten Scripts

Came across a script I wrote some time ago. Sitting there in my user directory was patch.cmd. As I find my scripts, I'm putting them in Git for historical purposes... and for a good laugh. What in the actual fuck are you, patch.cmd? --Rich One thing I learned;  document the damn things.  I had no idea what this was, but I knew it was mine … [Read more...]

Get File Count Recursively

I've been working on a small tool to aid in removing duplicate files and as I'm going back over my roughed in code, I'm trying to optimize it for some performance gains. This snippet of code works really well for recursively counting files given a specific path.  I originally found it at StackOverflow and slightly modified to suit my needs. Sub … [Read more...]

Office.com Online using WinForms

This isn't true API access, just a WebBrowser control. I'm looking into the API though which would require me to register my Application even though it's not a Windows App. It has a launcher (I haven't decided exactly how I'll integrate this) that will launch the Microsoft Office Online services at the click of a button. As you can see, you can … [Read more...]

Change User-Agent in WebBrowser Control

This snippet of code worked when tested in VB.NET application I'm working on. It will set the User Agent string for the duration of the control. Private Property uag As String = Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko _ Private Shared Function UrlMkSetSessionOption(ByVal dwOption As Integer, ByVal pBuffer As … [Read more...]