<commit_before>#|
 This file is a part of Chirp
 (c) 2013 TymoonNET/NexT http://tymoon.eu (<EMAIL>)
 Author: <NAME> <<EMAIL>>
|#

(in-package #:org.tymoonnext.chirp)

(defvar *statuses/update* "https://api.twitter.com/1.1/statuses/update.json")

(defun prepare (parameters)
  (mapc #'(lambda (pair)
            (unless (stringp (cdr pair))
              (setf (cdr pair) (write-to-string (cdr pair)))))
        (delete () parameters :key #'cdr)))

(defun status-update (status &key reply-to lat lng place display-coordinates)
  (let ((parameters (prepare `(("status" . ,status)
                               ("in_reply_to_status_id" . ,reply-to)
                               ("lat" . ,lat)
                               ("long" . ,lng)
                               ("place_id" . ,place)
                               ("display_coordinates" . ,display-coordinates)
                               ("trim_user" . "T")))))
    (signed-request *statuses/update* :parameters parameters)))<commit_msg>Added tweet class<commit_after>#|
 This file is a part of Chirp
 (c) 2013 TymoonNET/NexT http://tymoon.eu (<EMAIL>)
 Author: <NAME> <<EMAIL>>
|#

(in-package #:org.tymoonnext.chirp)

(defvar *statuses/update* "https://api.twitter.com/1.1/statuses/update.json")

(defclass tweet ()
  ((%id :initarg :id :accessor id)
   (%text :initarg :text :accessor text)
   (%created :initarg :created :accessor created)
   (%user :initarg :user :accessor user)
   (%source :initarg :source :accessor source)
   (%language :initarg :language :accessor language)
   (%parent :initarg :parent :accessor parent)
   (%parent-user :initarg :parent-user :accessor parent-user)
   (%location :initarg :location :accessor location)
   (%contributors :initarg :contributors :accessor contributors)
   (%hashtags :initarg :hashtags :accessor hashtags)
   (%urls :initarg :urls :accessor urls)
   (%symbols :initarg :symbols :accessor symbols)
   (%mentions :initarg :mentions :accessor mentions)
   (%retweeted :initarg :retweeted :accessor retweeted)
   (%favorited :initarg :favorited :accessor favorited)
   (%favorite-count :initarg :favorite-count :accessor favorite-count)
   (%retweet-count :initarg :retweet-count :accessor retweet-count))
  (:documentation ""))

(defmethod print-object ((tweet tweet) stream)
  (print-unreadable-object (tweet stream :type T)
    (format stream "~a #~d" (user tweet) (id tweet)))
  tweet)

(defun make-tweet (json-data)
  )

(defun status-update (status &key reply-to lat lng place display-coordinates)
  (let ((parameters (prepare `(("status" . ,status)
                               ("in_reply_to_status_id" . ,reply-to)
                               ("lat" . ,lat)
                               ("long" . ,lng)
                               ("place_id" . ,place)
                               ("display_coordinates" . ,display-coordinates)
                               ("trim_user" . "T")))))
    (make-tweet (signed-request *statuses/update* :parameters parameters))))
{'fraction_non_alphanumeric': 0.14571523841280426, 'fraction_numerical': 0.0040013337779259755, 'mean_word_length': 2.575685339690107, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6362086', 'n_tokens_mistral': 976, 'n_tokens_neox': 950, 'n_words': 239}