Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simplified the db driver package

  • Loading branch information...
commit a947a8b6fe1aa727703fc9d47eca2e6421c5db8f 1 parent 0de2980
@fons authored
View
2  api/twitter-cache.lisp
@@ -1,5 +1,6 @@
(in-package :cl-twitter)
+(defvar *cache-spec-file* "cache.spec" "cache specification; contains types to cache")
(defvar *twitter-object-cache* (make-hash-table) "twitter object cache, in memory")
(defun twitter-object-cache (type)
@@ -84,7 +85,6 @@
(let ((name (twitter-user-screen-name ref)))
(gethash name (twitter-object-cache 'twitter-user) )))
-(defvar *cache-spec-file* "cache.spec" "cache specification; contains types to cache")
(defun cache-spec ()
(default-file-path "db/" *cache-spec-file*))
View
1  api/twitter-db.lisp
@@ -47,7 +47,6 @@
(defun use-db (driver-package &key (spec nil specp) (tag :default))
(when driver-package
- (require :cl-twitter-db)
(require driver-package)
(use-package driver-package)
(when specp (write-driver-spec (list :TAG tag :DRIVER driver-package :SPEC spec)))
View
5 db/mongodb-driver.lisp
@@ -4,7 +4,6 @@
(defvar *mongodb-port* nil)
(defvar *mongodb-db* nil)
-
(defun connection ()
(handler-case
(cl-mongo:mongo :host *mongodb-host* :port *mongodb-port* :db *mongodb-db* :name :twitter)
@@ -13,8 +12,7 @@
(format t "error detected when opening connection : ~S~%" c)
(cl-mongo:mongo-close :twitter)))))
-(defun mongodb-connect (connection-plist)
- (format t "initializing mongodb..~%")
+(defun mongodb-connect (connection-plist) (format t "initializing mongodb..~%")
(setf *mongodb-host* (or (getf connection-plist :host) "localhost"))
(setf *mongodb-port* (or (getf connection-plist :port) cl-mongo::+MONGO-PORT+))
(setf *mongodb-db* (or (getf connection-plist :db) "twitter"))
@@ -51,7 +49,6 @@
(push (subseq str (car item) (cdr item)) lst))
(nreverse lst)))
-
(defun decode-to-hash-table (lst)
(let ((ht (make-hash-table :test 'equal)))
(labels ((assocp (lst)
View
23 twitter-elephant-driver.asd
@@ -0,0 +1,23 @@
+(in-package :cl-user)
+
+(defpackage #:elephant-driver-asd
+ (:use :cl :asdf))
+
+(in-package :elephant-driver-asd)
+
+(defsystem twitter-elephant-driver
+ :name "ELEPHANT-DRIVER"
+ :version "0.5"
+ :maintainer "Fons Haffmans"
+ :author "Ian Eslick"
+ :licence "LLGPL"
+ :description "An elephant db driver for cl-twitter"
+ :components
+ ((:module "db"
+ :serial t
+ :components (
+ (:file "elephant-driver-package")
+ (:file "elephant-driver")
+ )))
+ :depends-on (:cl-twitter :elephant))
+
View
22 twitter-mongodb-driver.asd
@@ -0,0 +1,22 @@
+(in-package :cl-user)
+
+(defpackage #:mongodb-driver-asd
+ (:use :cl :asdf))
+
+(in-package :mongodb-driver-asd)
+
+(defsystem twitter-mongodb-driver
+ :name "MONGODB-DRIVER"
+ :version "0.5"
+ :maintainer "Fons Haffmans"
+ :author "Fons Haffmans"
+ :licence "LLGPL"
+ :description "A mongodb driver for cl-twitter"
+ :components
+ ((:module "db"
+ :serial t
+ :components (
+ (:file "mongodb-driver-package")
+ (:file "mongodb-driver")
+ )))
+ :depends-on (:cl-twitter :cl-mongo))
Please sign in to comment.
Something went wrong with that request. Please try again.