HScD / src / Network / SoundCloud.hs

{- |
   Module:      Network.SoundCloud
   Copyright:   (c) 2012 Sebastián Ramírez Magrí <>
   License:     BSD3
   Maintainer:  Sebastián Ramírez Magrí <>
   Stability:   experimental

   The 'Network.SoundCloud' module provides functions and types to access
   the public API.

module Network.SoundCloud (
  ) where

import Network.SoundCloud.Util (scGet, scFetch, scResolve, scResourceType)

import qualified Network.SoundCloud.App         as App
import qualified Network.SoundCloud.Group       as Group
import qualified Network.SoundCloud.Set         as Set
import qualified Network.SoundCloud.Track       as Track
import qualified Network.SoundCloud.User        as User

-- | Show information about the resource pointed by the given API URL
scResourceShowInfo :: String -> IO ()
scResourceShowInfo url | scResourceType url == "track"   = Track.showInfo url
                       | scResourceType url == "user"    = User.showInfo url
                       | scResourceType url == "set"     = Set.showInfo url
                       | scResourceType url == "group"   = Group.showInfo url
                       | scResourceType url == "app"     = App.showInfo url
scResourceShowInfo _                                     = putStrLn "Unrecognized resource"

-- | Show information about a resource given its public URL
scShowInfo :: String -> IO ()
scShowInfo url =
    do rUrl <- scResolve url
       scResourceShowInfo rUrl
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.