                       , post_item_tags = [ PostTag "Haskell" [] ]
                         , post_item_private = True
                         , post_item_gist = False
                         , post_item_tweet = False
                         }
  postedS <- postItem newItem

  case postedS of
    Left     err -> liftIO $ print err
    Right posted -> do
      let updated = itemToUpdateItem posted
      updatedS <- updateItem updated {
                  
runUpdateItem :: IO ()
runUpdateItem = do
  putStrLn "ユーザ名を入力してEnter、次にパスワードを入力してEnterを押すこと！"
  input <- getContents
  lines <- return $ lines input

  let user = C8.pack $ lines !! 0
  let pass = C8.pack $ lines !! 1

  withAuthentication user pass
        (\err limit -> print err >> print limit) -- 認証エラー時の処理
       (\ctx -> evalStateT runUpdateItemCore ctx) -- 認証OK後の処理
runUpdateItem = do
  putStrLn "ユーザ名を入力してEnter、次にパスワードを入力してEnterを押すこと！"
  input <- getContents
  lines <- return $ lines input

  let user = C8.pack $ lines !! 0
  let pass = C8.pack $ lines !! 1

  withAuthentication user pass
        (\err limit -> print err >> print limit) -- 認証エラー時の処理
       (\ctx -> evalStateT runUpdateItemCore ctx) -- 認証OK後の処理