packages feed

rezoom (empty) → 0.0.1

raw patch · 6 files changed

+271/−0 lines, 6 filesdep +HTTPdep +basedep +bytestringsetup-changed

Dependencies added: HTTP, base, bytestring, containers, datetime, json, nano-md5, xhtml

Files

+ LICENSE view
@@ -0,0 +1,12 @@+This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ Main.hs view
@@ -0,0 +1,72 @@+import Network.HTTP+import Network.Stream+import Rezoom.JSON+import Rezoom.Builder+import System.IO+import System.Environment (getArgs)+import System.Console.GetOpt+import Control.Monad (join)+import Control.Applicative ((<$>))+import qualified Data.Map as M++version = "0.0.1"++data Flag = Version |+            Output String |+            Realname String |+            Email String |+            Facebook String |+            Twitter String |+            Username String+            deriving (Show, Eq)++-- Content of the API response+getAPI :: String -> IO String+getAPI username = join $ do+    let url = "http://github.com/api/v2/json/repos/show/" ++ username+    req <- simpleHTTP $ getRequest url+    putStrLn "Connected to API..."+    case req of+        Left err -> do error "Couldn't ping API. Try again later."+        x -> do return $ getResponseBody x+        +options :: [OptDescr Flag]+options = [+            Option ['v'] ["version"] (NoArg Version) "show rezoom's version number and exit",+            Option ['o'] ["output"] (ReqArg Output "FILE") "where to put the generated resume (default ./resume.html)",+            Option ['e'] ["email"] (ReqArg Email "ADDR") "your email address (also needed for your gravatar)",+            Option ['n'] ["name"] (ReqArg Realname "NAME") "your real name",+            Option ['f'] ["facebook"] (ReqArg Facebook "URL") "your Facebook profile URL",+            Option ['t'] ["twitter"] (ReqArg Twitter "URL") "your Twitter URL"+          ]+          +saneOpts :: [Flag] -> [(String, String)]+saneOpts [] = []+saneOpts (x:xs) = flip (:) (saneOpts xs) $ case x of+    Version -> ("version", "")+    Output str -> ("output", str)+    Realname str -> ("realname", str)+    Email str -> ("email", str)+    Facebook str -> ("facebook", str)+    Twitter str -> ("twitter", str)+    Username str -> ("username", str)+    ++header :: String+header = "Usage: rezoom [username] [options...]"++main :: IO ()+main = do+    args <- getArgs+    case getOpt Permute options args of+        (flags, [], []) -> if Version `elem` flags then do putStrLn ("rezoom " ++ version)+            else do error $ usageInfo header options+        (_, [], _) -> error $ "Username required!\n" ++ usageInfo header options+        (flags, username:_, []) -> do+            let sane = M.fromList $ saneOpts $ (Username username):flags;+                filename = M.findWithDefault "resume.html" "output" sane+            html <- (build sane) <$> parse <$> getAPI username+            putStrLn "Built resume..."+            html >>= (\e -> writeFile filename e)+            putStrLn "All done."+        (_, _, msgs) -> error $ concat msgs ++ usageInfo header options
+ README view
@@ -0,0 +1,1 @@+rezoom -h
+ Rezoom/rezoom.css view
@@ -0,0 +1,162 @@+* {+	margin: 0;+	padding: 0;+}++body {+	background: #404040;+	font-family: Ubuntu, Aller, Arial, sans-serif;+	-webkit-font-smoothing: antialiased;+}++a {+	color: #4ec3e2;+	text-decoration: none;+}++a:hover {+	text-decoration: underline;+}++#container {+	width: 600px;+	margin: 50px auto;+	background: #f2f2f2;+	border-top: 12px solid #2b2b2b;+}++#container-inner {+	border-top: 12px solid #4ec3e2;+	padding: 30px;+}++#avatar {+	float: left;+	border: 4px solid #a1a1a1;+	background: #d7d7d7;+	margin-right: 18px;+}++#avatar img {+	display: block;+}++#header {+	overflow: hidden;+	padding-bottom: 15px;+}++#header h2, #header h4 {+	float: left;+	width: 358px;+}++#header h2 {+	font-weight: normal;+	color: #5f5f5f;+	font-size: 32px;+	letter-spacing: -1px;+	padding-top: 12px;+}++h4 {+	margin-top: 12px;+	font-size: 15px;+}++h4 li {+	float: left;+	list-style: none;+	padding-right: 6px;+	font-weight: normal;+}++h4 li:before {+	content: "+";+	color: #858585;+}++h4 li a {+	color: #858585;+}++#header h2 b {+	font-weight: normal;+	color: #c8c8c8;+	padding: 0 8px;+}++.section {+	overflow: hidden;+	padding-top: 15px;+	border-top: 1px solid #d7d7d7;+	margin-top: 15px;+}++.langs h3 {+	font-weight: bold !important;+}++h3.side {+	padding-top: 5px;+	float: left;+	width: 130px;+	color: #666;+	font-size: 24px;+	font-weight: normal;+	font-style: italic;+}++.subsection {+	float: right;+	width: 398px;+}++.langs li {+	float: left;+	list-style: none;+	margin-right: 4px;+	margin-bottom: 4px;+}++.langs li a {+	display: block;+	color: white;+	background: #4ec3e2;+	padding: 4px;+	-webkit-transition: background-color 0.1s linear;+	-webkit-border-radius: 3px;+	-moz-border-radius: 3px;+	border-radius: 3px;+	white-space: nowrap;+}++.langs li a:hover {+	text-decoration: none;+	background: #404040;+}++.project {+	list-style: none;+	padding-bottom: 17px;+	border-bottom: 1px solid #ddd;+	margin-bottom: 13px;+}++.project:last-child {+	border-bottom: none;+	padding-bottom: 0;+	margin-bottom: 0;+}++.project .description {+	padding-top: 7px;+	font-size: 15px;+	color: #333;+}++.pushed {+	font-weight: normal;+	font-size: 12px;+	color: #888;+}
+ Setup.lhs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+> import Distribution.Simple+> main = defaultMain
+ rezoom.cabal view
@@ -0,0 +1,21 @@+Cabal-Version:	>= 1.6+Name:			rezoom+Version:		0.0.1+Synopsis:		Github resume generator+Description:	Generates a resume from your github page.+License:		GPL+License-File:	LICENSE+Author:			Joel Taylor+Maintainer:		Joel Taylor <barebonesgraphics@gmail.com>+Build-Type: Simple+Data-Files:		Rezoom/rezoom.css+Extra-Source-Files:	README+Category:		Utils++source-repository head+    type: git+    location: git://github.com/incluye/rezoom.git++Executable rezoom+    Main-is: Main.hs+    Build-Depends: base == 4.*, json == 0.5.*, xhtml == 3000.*, HTTP == 4000.*, nano-md5 == 0.1.*, bytestring == 0.9.*, datetime == 0.2.*, containers == 0.4.*