Closed GoogleCodeExporter closed 9 years ago
I implemented that function so:
''' <summary>
''' Downloads search results for Yahoo IDs by keyword and other options
''' </summary>
''' <param name="text">The used search text</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function Download(ByVal text As String) As API.IDSearchResponse
If text.Trim = String.Empty Then Throw New ArgumentNullException("text", "The text is empty.")
Dim url As String = Me.DownloadURL(text, mOptions, 0)
Dim resp = MyBase.DownloadString(url)
Return New API.IDSearchResponse(resp.Connection, Me.ToSearchResults(resp.Result, mOptions.Server))
End Function
(--> ToSearchResults and DownloadURL functions changed; in next version
different servers will be supported; different server = different priority for
loacalized search results; i.e. Server=Germany --> more results for german
stock exchanges in NoRanking-mode (new value in RankedBy option); supported
servers at the moment: Canada, France, Germany, Spain, UK, USA)
NonAPI.IDSearch inherits from Base.StringDownload so you don't need an extra
Encoding (MyBase.DownloadString). Also, because of being a sync download
Download function doesn't need userArgs, because you can access the same
parameters/options after calling the function. There is no possibility in sync
download to change or lost options configuration while downloading. ([Options]
property in IDSearchDownloadCompletedEventArgs exists because of that issue;
it's a clone from the options when downloading started)
A problem is the [Count] option. It suggests a possibility of getting more than
20 results, but it's not the case in sync downloading. You can just download
maximum 20 results per request.
I didn't implement a limiting function for a [Count] less than 20. That would
be possible by deleting received reults from the array. You'll always get 20
results or the rest count depending to the [Start] option (i.e. Start=20;
MaxResults=22; ResultCount=2).
greetz
Maas
Original comment by Maas...@gmail.com
on 2 Jul 2011 at 2:54
fixed/done
Original comment by Maas...@gmail.com
on 14 Jul 2011 at 10:01
Original issue reported on code.google.com by
i...@advancedcomputing.ch
on 1 Jun 2011 at 12:31