Blogging and News Syndication Software

Blogger API, RSS API, Atom API, and more.
posts - 17, comments - 14, trackbacks - 26

My Links

News

Tortuga Components / Software Tools Home

See Also: Chilkat Software

Article Categories

Archives

Post Categories

Recommended

MetaWeblog API VB Example: NewPost with NewMediaObject

Visual Basic sample code using the Tortuga MetaWeblog ActiveX to create a new blog post with an image that is uploaded from the local filesystem to the blog server.
The Tortuga Beta ActiveX can be downloaded from MetaWeblog ActiveX
The download contains an ActiveX DLL that needs to be registered using regsvr32.exe. You may then import the "Tortuga ActiveX" into your VB project.

    ' Use the Blogger 1.0 API to get the Blog ID
    Dim b1 As New Blogger1
    b1.Login = "myLogin"
    b1.Password = "myPassword"
    b1.ServiceUrl = "http://www.squarespace.com/do/process/external/PostInterceptor"
    b1.GetUsersBlogs
    blogId = b1.GetBlogId(0)

    ' Use MetaWeblog to create a new post
    Dim mwlog As New MetaWeblog
    mwlog.Login = "myLogin"
    mwlog.Password = "myPassword"
    mwlog.ServiceUrl = "http://www.squarespace.com/do/process/external/PostInterceptor"
    
    ' Upload a GIF file to the server.
    localFile = "c:/images/dude.gif"
    remoteFile = "coolDude.gif"
    
    imageUrl = mwlog.NewMediaObject(blogId, localFile, remoteFile)
    
    postContent = "This is a new post with an image <img src=""" + imageUrl + """>"
    postTitle = "Sample post with image"
    
    Dim postId As String
    publish = 1
    postId = mwlog.NewPost(blogId, postTitle, postContent, publish)
    
    MsgBox "This ID of the post created = " + postId
    

Print | posted on Friday, September 23, 2005 8:52 PM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: