File: postWithMedia.hs

package info (click to toggle)
haskell-twitter-conduit 0.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 284 kB
  • sloc: haskell: 2,066; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE OverloadedStrings #-}

module Main where

import Common
import Web.Twitter.Conduit

import qualified Data.Text as T
import System.Environment

main :: IO ()
main = do
    [status, filepath] <- getArgs
    putStrLn $ "Post message: " ++ status
    twInfo <- getTWInfoFromEnv
    mgr <- newManager tlsManagerSettings
    res <- call twInfo mgr $ statusesUpdateWithMedia (T.pack status) (MediaFromFile filepath)
    print res