Share your pearls of wisdom about the API with your fellow developers! Do it for the karma (and the glory).
There's no set format, but please try to make it readable with a clear title.
==============================================================================
NET Blogger API
A little help for query-ing blog feeds
The function is self-explaining...but I just make it clear.
You pass parameters such as Label, MaxResult, StartIndex and keyword to search
Label: HarryPotter
MaxResult: 10
StartIndex: 1
http://myblog.blogspot.com/feeds/posts/default/-/HarryPottermax-results\07510&start-index\0751&orderby=updated
The keyword search doesn\47t seem to work yet. I wonder why too.
Anyway this just serves as it, in case you are lazy to form the query.
Any enhancements are welcome :)
Public Function FormQuery(ByVal labelName As String, _
ByVal maxResult As String, _
ByVal startIndex As String, _
ByVal keyTerms As String, _
Optional ByVal orderByPublished As Boolean = False) As String
Dim addAmp As Boolean = False
Dim searchQ As String = String.Empty
If labelName = String.Empty Then
searchQ = "http://myblog.blogspot.com/feeds/posts/default"
Else
searchQ = "http://myblog.blogspot.com/feeds/posts/default/-/" & labelName
End If
If maxResult <> String.Empty Then
searchQ &= "max-results=" & maxResult
addAmp = True
End If
If startIndex <> String.Empty Then
If addAmp Then
searchQ &= "&start-index=" & startIndex
Else
searchQ &= "start-index=" & startIndex
addAmp = True
End If
End If
' orderby=updated
' orderby=published
' &sortorder=ascending
If orderByPublished Then
If addAmp Then
searchQ &= "&orderby=published"
Else
searchQ &= "orderby=published"
addAmp = True
End If
Else
If addAmp Then
searchQ &= "&orderby=updated"
Else
searchQ &= "orderby=updated"
addAmp = True
End If
End If
If keyTerms <> String.Empty Then
keyTerms = keyTerms.Replace(" ", "%20")
If addAmp Then
searchQ &= "&q=" & keyTerms
Else
searchQ &= "q=" & keyTerms
addAmp = True
End If
End If
Return searchQ
End Function