public class Crawler : IDisposable
Public Class Crawler
Implements IDisposable
Dim instance As Crawler
public ref class Crawler : IDisposable
type Crawler =
class
interface IDisposable
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Imports FHM
Public Module Module1
Private WithEvents FHMCrawler As New Crawler
Private mre As New ManualResetEvent(initialState:=False)
Public Sub Main()
FHMCrawler.SearchQuery.Artist = "Linkin Park"
Console.WriteLine("Search Params: {0}", FHMCrawler.SearchQuery.ToString())
Console.WriteLine()
Console.WriteLine("Absolute Uri: {0}", FHMCrawler.SearchQuery.Uri.AbsoluteUri)
Console.WriteLine()
Console.WriteLine("Retrieving Album count...")
Dim albumCount As Integer = FHMCrawler.GetAlbumCount()
Console.WriteLine("Album Count: {0}", albumCount)
Console.WriteLine()
Console.WriteLine("Begin crawling, please wait...")
Fetch()
mre.WaitOne()
Console.WriteLine("Done!. Press any key to exit...")
Console.ReadKey()
End Sub
Public Async Sub Fetch()
Dim success As Boolean = Await FHMCrawler.FetchAlbumsAsync()
mre.Set()
End Sub
Private Sub FHMCrawler_PageCrawlBegin(ByVal sender As Object, e As PageCrawlBeginEventArgs) Handles FHMCrawler.PageCrawlBegin
Console.WriteLine("[+] Begin crawling page with index: {0}", e.SearchPage)
Console.WriteLine()
End Sub
Private Sub FHMCrawler_PageCrawlEnd(ByVal sender As Object, e As PageCrawlEndEventArgs) Handles FHMCrawler.PageCrawlEnd
For Each albumInfo As AlbumInfo In e.Albums
Dim sb As New StringBuilder()
sb.AppendLine(String.Format("Artist Name.....: {0}", albumInfo.Artist))
sb.AppendLine(String.Format("Album Title.....: {0}", albumInfo.Title))
sb.AppendLine(String.Format("Album Year......: {0}", albumInfo.Year))
sb.AppendLine(String.Format("Album Country...: {0}", albumInfo.Country))
sb.AppendLine(String.Format("Album Genre.....: {0}", albumInfo.Genre))
sb.AppendLine(String.Format("Album Id........: {0}", albumInfo.Id))
sb.AppendLine(String.Format("Album Url.......: {0}", albumInfo.Uri.AbsoluteUri))
sb.AppendLine(String.Format("Download Link(s): {0}", String.Format("{{ {0} }}", String.Join(", ", albumInfo.DownloadLinks))))
Console.WriteLine(sb.ToString())
Next albumInfo
Console.WriteLine("[+] End crawling page with index: {0}", e.SearchPage)
Console.WriteLine()
End Sub
End Module
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Crawler | Initializes a new instance of the Crawler class. |
SearchQuery | Gets the search query. |
CancelFetchAlbumsAsync | Aborts a pending fetch operation started by a call to FetchAlbumsAsync function. |
Dispose | Releases all the resources used by this Crawler. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
FetchAlbums | Fetch any album found using the current search query. |
FetchAlbumsAsync | Asynchronously fetch any album found using the current search query. |
GetAlbumCount | Gets the count of the albums found using the current search query. |
GetAlbumCountAsync | Asynchronously gets the count of the albums found using the current search query. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ResetSearchQuery | Resets the current search query (SearchQuery) to its default values. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
PageCrawlBegin | Occurs when a page is about to be crawled. |
PageCrawlEnd | Occurs when a page is crawled. |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |