aboutsummaryrefslogtreecommitdiff
path: root/src/Model/URL.hs
blob: 04fcf6bc639d7e46f46a80384869a2eefcc8f4dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE OverloadedStrings #-}

module Model.URL
  ( URL
  , getIdURL
  , getMaterialURL
  , site
  ) where

import Data.Text (Text)
import qualified Data.Text as T

type URL = Text

getIdURL :: Text -> URL
getIdURL material =
  T.concat
    [ site
    , "/ajax/global.php?term="
    , T.replace " " "+" material
    ]

getMaterialURL :: Text -> URL
getMaterialURL materialId = T.concat [site, "/fiche-matiere-", materialId, ".php"]

site :: URL
site = "http://olfatheque.com"