B4A Library XKCD Library

Discussion in 'Additional libraries, classes and official updates' started by sonicmayne, Jul 9, 2015.

  1. sonicmayne

    sonicmayne Member Licensed User

    This is a library that allows you to get information about single comics, or all of the XKCD comics.

    It allows you to get the first comic, latest comic, specified comic, get a list of all comics, get a list of comics that match a given query and get the URL of the comic.

    Requires Android 2.3+

    XKCD
    Version:
    1
    • XKCD
      Events:
      • Done (Result As XKCDComic)
      • Error (Message As String)
      • ListComics (Comics As List)
      Methods:
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • GetComic (Comic As Int) As String
        Raised the _Done event with the sepcified XKCD comic.
        Raises the _Error event if something went wrong whilst doing the request.
      • GetExplanationURL (Comic As Int) As String
        Returns the explainxkcd.com URL for the given comic for opening in a web browser.
      • GetFirstComic As String
        Raises the _Done event with the first XKCD comic.
        Raises the _Error event if something went wrong whilst doing the request.
      • GetLatestComic As String
        Raises the _Done event with the most recent XKCD comic.
        Raises the _Error event if something went wrong whilst doing the request.
      • GetNextComic (Comic As Int) As Int
        Returns the number of the next comic. Does not take into account what the most recent comic is.
        Takes into account that comic 404 does not exist.
      • GetPreviousComic (Comic As Int) As Int
        Returns the number of the previous comic. Takes into account the first comic, for example if comic is less than or equal to 1 returns Comic.
        Takes into account that comic 404 does not exist.
      • GetRandomComic As String
        Raises the _Done event with a random XKCD comic.
        Raises the _Error event if something went wrong whilst doing the request.
      • GetURL (Comic As Int) As String
        Returns the XKCD.com URL for the given comic for opening in a web browser.
      • Initialize (Module As Object, EventName As String) As String
        Sets the module and subs that will handle the events.
      • ListComics As String
        Raises the _ListComics event with a list of XKCDListItem items.
        Raises the _Error event if something went wrong whilst doing the request.
      • SearchComics (Query As String) As String
        Raises the _ListComics event with a list of XKCDListItem items whose title contain Query.
        Raises the _Error event if something went wrong whilst doing the request.
    • XKCDComic
      Fields:
      • Alt As String
      • Day As Int
      • Image As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Link As String
      • Month As Int
      • News As String
      • Num As Int
      • SafeTitle As String
      • Title As String
      • Transcscript As String
      • Year As Int
      Methods:
      • Initialize
        Initializes the fields to their default value.
    • XKCDListItem
      Fields:
      • Date As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Number As Int
      • Title As String
      Methods:
      • Initialize
        Initializes the fields to their default value.
     

    Attached Files:

    DavideV, Erel, coslad and 2 others like this.
Loading...