boards.ie

Go Back   boards.ie > Tech > Software and Web Development > Development

Notices

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-11-2009, 06:31   #1
techguy
Registered User
 
Join Date: Jun 2004
Location: 011011100110
Posts: 1,414
Send a message via Skype™ to techguy
Using web APIs -TweetPhoto.

Hi,

I'm trying to develop a small app to upload to TweetPhoto using the API with Visual Basic.

I'm not really to sure about how to use this. I ama aware that I need to setup a WebRequest object then setup headers etc but i'm getting lost along the way.

Does anybody know of any tutorials on how to use these Web APIs with VB?

I'm not having much luck with Google as I don't really know what to look for. What is the proper name for a web API like this? Web Service??
__________________
Check your Eircom broadband usage from your desktop with this.

Send SMS from your desktop using MS Outlook contacts with this
techguy is offline   Reply With Quote
Advertisement

To remove these adverts, please create an account, or log in! You must have an account to post anyway :-)
Old 06-11-2009, 14:02   #2
amen
Registered User
 
Join Date: Oct 1999
Location: Galway
Posts: 995
which version of VB are you using ?
.Net or VB6 ?
amen is offline   Reply With Quote
Old 06-11-2009, 16:56   #3
techguy
Registered User
 
Join Date: Jun 2004
Location: 011011100110
Posts: 1,414
Send a message via Skype™ to techguy
I'm using VB.NET 3.5

I found out that TweetPhoto uses the REST web service protocol but have yet to find a decent gudie on this.

My main problems are serializing the image to a byte array then streaming the data along with headers to the tweetphoto site.

Has anybody done anything like this before?
__________________
Check your Eircom broadband usage from your desktop with this.

Send SMS from your desktop using MS Outlook contacts with this
techguy is offline   Reply With Quote
Old 06-11-2009, 17:24   #4
ronivek
Registered User
 
Join Date: Mar 2007
Location: Dublin
Posts: 163
I can't really help you with the VB stuff but a RESTful web service is pretty straightforward to interact with.

Basically in this case you're using HTTP methods to interact with the web service; GET to read a resource, POST to create a resource, PUT to update a resource and so on.

I'm sure there must be some sort of VB library that'll provide the HTTP methods for you; so all you need to do is create the HTTP request and fire it off. All the information on the format of the request should be provided in the documentation for the TweetPhoto API in terms of any headers you need to set etc.

A Java implementation example would be;
Code:
HTTPRequest request = HTTPClient.createRequest("http://tweetphotoapi.com/api/tpapi.svc/upload2");
request.setMethod("POST");
request.setHeader("TPAPIKEY", "someKey");
request.setContentType("application/x-www-form-urlencoded");
request.setContentLength(imageFile.getLength());
request.setBody(imageFile.getBytes());
That's just to give you a vague idea of how you'd go about creating a HTTP request to add a photo using that API. You'll just need a HTTP library and some kind of File I/O (or preferably a specific Image File I/O library) and it shouldn't be too difficult.

Here's a decent article that might help with the HTTP end of things.

Last edited by ronivek; 06-11-2009 at 17:35.
ronivek is offline   Reply With Quote
Thanks from:
Old 07-11-2009, 00:27   #5
techguy
Registered User
 
Join Date: Jun 2004
Location: 011011100110
Posts: 1,414
Send a message via Skype™ to techguy
Quote:
Originally Posted by ronivek View Post
_
Cool, you make it look pretty easy.

I just found that yahoo link too.. it's pretty useful and easy to read.

Thanks for all your help!!
__________________
Check your Eircom broadband usage from your desktop with this.

Send SMS from your desktop using MS Outlook contacts with this
techguy is offline   Reply With Quote
Reply
  boards.ie > Tech > Software and Web Development > Development Top

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 23:49.


© boards.ie Ltd. (Ireland) - Hosted by Digiweb Hosting. Message Boards and Forums Directory