Menu Sidebar
Menu

How to: Update Pownce using ASP

By StrangeWork.com: On February 28th, 2008 Pownce released version 2.0 of their API. The major update in this new version is the ability to post messages, links, files, events and even replies via the API directly to a Ponwce.com account.

Pownce LogoBelow is an ASP script I wrote to update your Pownce profile automatically through the new API. I’ve included the complete script for download at the bottom of this post.

Pownce requires the username and password values be encoded using base64. Below is an ASP function that will convert any value over to base64 encode.

const BASE_64_MAP_INIT = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”
dim nl
‘ zero based arrays
dim Base64EncMap(63)
dim Base64DecMap(127)

‘ must be called before using anything else
PUBLIC SUB initCodecs()
‘ init vars
nl = “

” & chr(13) & chr(10)
‘ setup base 64
dim max, idx
max = len(BASE_64_MAP_INIT)
for idx = 0 to max – 1
‘ one based string
Base64EncMap(idx) = mid(BASE_64_MAP_INIT, idx + 1, 1)
next
for idx = 0 to max – 1
Base64DecMap(ASC(Base64EncMap(idx))) = idx
next
END SUB

‘ encode base 64 encoded string
PUBLIC FUNCTION base64Encode(plain)

if len(plain) = 0 then
base64Encode = “”
exit function
end if

dim ret, ndx, by3, first, second, third
by3 = (len(plain) 3) * 3
ndx = 1
do while ndx <= by3 first = asc(mid(plain, ndx+0, 1)) second = asc(mid(plain, ndx+1, 1)) third = asc(mid(plain, ndx+2, 1)) ret = ret & Base64EncMap( (first 4) AND 63 ) ret = ret & Base64EncMap( ((first * 16) AND 48) + ((second 16) AND 15 ) ) ret = ret & Base64EncMap( ((second * 4) AND 60) + ((third 64) AND 3 ) ) ret = ret & Base64EncMap( third AND 63) ndx = ndx + 3 loop ' check for stragglers if by3 < len(plain) then first = asc(mid(plain, ndx+0, 1)) ret = ret & Base64EncMap( (first 4) AND 63 ) if (len(plain) MOD 3 ) = 2 then second = asc(mid(plain, ndx+1, 1)) ret = ret & Base64EncMap( ((first * 16) AND 48) + ((second 16) AND 15 ) ) ret = ret & Base64EncMap( ((second * 4) AND 60) ) else ret = ret & Base64EncMap( (first * 16) AND 48) ret = ret & "=" end if ret = ret & "=" end if base64Encode = ret END FUNCTION ' initialize call initCodecs

Every site/script that interacts with the Pownce API requires an application key. To get your application key, simply register a new application on Pownce. Just replace {app_key} in the below script with the application key that Pownce provides to you.

In this example we will be posting a LINK to your Pownce profile. Be sure to reference the Pownce 2.0 API documentation for specifications on posting messages, events, files, etc.

‘*** set your Pownce username and password variables
p_username = “username”
p_password = “password”

p_username = p_username & “:” & p_password

‘*** Base64 encode your username and password
p_username = base64Encode(p_username)

‘*** replace {app_key} with YOUR application key
strPownce = “http://api.pownce.com/2.0/send/link.xml?app_key={app_key}”

‘*** the link you want to post to Pownce
pownce_link = “http://snapfoo.com/images/snapfoo_logo.jpg”

‘*** the description you want to post to Pownce
pownce_update = “SnapFoo.com Logo – Foo You!”

Set xml = Server.CreateObject(“Microsoft.XMLHTTP”)
xml.Open “POST”, strPownce, False
xml.setRequestHeader “Content-Type”, “application/x-www-form-urlencoded”
xml.setRequestHeader “Authorization”, “BASIC ” & p_username
xml.Send(“note_to=public&url=” & pownce_link & “&note_body=”&pownce_update)

‘*** view the Pownce response
Response.Write xml.responseText

Set xml = Nothing

That’s it! Using the above method you can easily create scripts to update Pownce with anything you would like.

Download Source File to Update Pownce using ASP

Indianapolis Twitter Meetup aka Tweetup

By StrangeWork.com: The first ever Indianapolis Tweetup has been scheduled!

Indianapolis Twitter Meetup Logo
The Twitter Meetup will take place on Friday March 14th at the Buffalo Wild Wings on 86th St. If you have not already make sure you visit the Upcoming event page and RSVP to help with a head count.

A Twitter Meetup, or Tweetup, is a local gathering of Twitter users. It gives anyone interested a chance to actually meet their Twitter friends face to face!

I will be attending and hope to see my Indianapolis Twitter friends there!

One Brad Williams To Rule Them All

By StrangeWork.com: After over a year of blogging I have finally taken over the number one spot on Google for the search term “Brad Williams”. It wasn’t an easy task, namely because there is a little person comedian of the same name that was on TV for a bit. Having a somewhat common name didn’t help either!

I realize everyone hits different Google servers and this could change at any minute, but for now it sticks and I have a picture for proof! BOOYA!

Google SERP for Brad Williams

WordPress Weekly Episode 7

By StrangeWork.com: After a busy couple weekends I was able to once again be a panel member on the WordPress Weekly Podcast.

WordPress Weekly PodcastThis week Jeff interviewed Tommy from Buzzdroid, the creator of the Shifter WordPress theme aka the WordPress theme killer.

We also covered a variety of topics including the importance of keeping your WordPress install current, the trustworthiness of themes and theme creators, and our favorite/worst theme trends.

Be sure to catch the show live Friday nights at 9pm EST on TalkShoe.com!

I’m leaving Batteries.com and Indiana

By StrangeWork.com: The time has finally come for me to move on from Batteries.com. Not only am I leaving Batteries.com, but I am also leaving Indiana and moving to New Jersey in April!

I’ve come to a crossroad in my life where I had to make a decision. Take the safe route and keep working in the corporate world at a cushy job, or take the less safe route and go with my passion of being an entrepreneur and start my own company and try to make it big. I can happily say I’m taking the less safe route and going for it!

I’m going to be working part time at a development firm, called InfoLoop, where my friend currently works. The rest of the time I will be working on building my new company (Web Dev Studios) and pushing my startup sites (SnapFoo.com, iHotties.net, etc)

This is a huge change in my life and an exciting time. As much as I love Indiana I think it’s time for me to go. In New Jersey I will be within driving distance to New York City, Philadelphia, Boston, and Washington DC. All of these locations have HUGE tech scenes and I’m really looking forward to all the conferences/gatherings that I’ll be able to attend.

I’m taking a huge risk by leaving, but in the words of Robert F. Kennedy:

“Only those who dare to fail greatly can ever achieve greatly.”

Wish me luck!

BarCamp Indianapolis 2008 Recap

By StrangeWork.com: Indianapolis held its first BarCamp on Saturday and I had the pleasure of attending the event!

BarCamp Indianapolis 2008 Logo
BarCamp Indy was organized by Scott Wilder and took place at the Unleavened Bread Cafe on Saturday February 9th, 2008.

It was great to see local tech enthusiasts getting together to share their knowledge and experiences with each other. Events like this are what Indianapolis needs if we ever want to become a technology focused city.

Below are the video presentations made during the event.

Rajan Chandi kicked off the event with his presentation on Going Green with Technology:

Pascal Calarco gave the next presentation on Linux Desktop: Making the Switch:

Next up was my presentation on The Future of Mobile Web:

Stephen James was next with his presentation on Graphic Web Design & CSS:

We broke for lunch and had some of the best pancakes I’ve ever had in my entire life!

Unleavened Bread Cafe Pancakes

Alex Connor gave his presentation on Simplifying your life in Spite of Technology

and last but not least was Neil Cox giving his wrap-up presentation titled Putting It All Together:

If you weren’t able to make it out I highly recommend attending the next BarCamp Indianapolis. Talk has already begun to start organizing the next event. Be sure to check out the Indianapolis BarCamp 2 Wiki to share your thoughts/ideas.

Newer Posts
Older Posts

Brad Williams Blog

WordPress and the Web

Who is Brad?

Brad Williams picture

Brad Williams is a computer programmer and tech junkie who enjoys exploring technology and sharing his knowledge and experience with others.

 

CEO of WebDevStudiosMaintainn, and Pluginize. Co-author of Professional WordPress and Professional WordPress Plugin Development.

 

Brad resides in Philadelphia.

 

 Subscribe in a reader

Professional WordPress Third Edition

Professional WordPress Plugin Development