<commit_before># flickr-robot
# https://github.com/cw/flickr
#
# Copyright (c) 2012 <NAME>
# Licensed under the MIT license.


Flickr = require('flickr-with-uploads').Flickr
client = new Flickr('0RjUImXvsYx2P8Gi4eZScFh9fkLJltDV', 'mbu87dOB0FWncTRJ',
    '3XF0pqP4daZf9oIlx-a7H1uMLeGrBidkJU', 'KpslBxHoh4QYk6ad')

exports.awesome = ->
  'awesome'

exports.readOptions = (callback) ->
  fs.readFile(path.join(__dirname, '.env'), 'utf8', (err, text) ->
    opts = {}
    if not err
      text.split(/\n/).forEach((line) ->
        line_parts = line.split(/\=/)
        opts[line_parts[0]] = line_parts[1]
      )
    callback(err, opts)
  )

exports.api = (method_name, data, callback) ->
  # overloaded as (method_name, data, callback)
  client.createRequest(method_name, data, true, callback).send()

exports.get_f = -><commit_msg>lots of rework as I try to figure out the right structure<commit_after># flickr-robot
# https://github.com/cw/flickr
#
# Copyright (c) 2012 <NAME>
# Licensed under the MIT license.

fs = require('fs')
path = require('path')
Flickr = require('flickr-with-uploads').Flickr

# internal helper functions
readOptions = (callback) ->
  pth = path.join(__dirname, "../.env")
  console.log "env file: #{pth}"
  fs.readFile(pth, 'utf8', (err, text) ->
    opts = {}
    if not err
      text.split(/\n/).forEach((line) ->
        line_parts = line.split(/\=/)
        opts[line_parts[0]] = line_parts[1]
      )
    callback(err, opts)
  )

# read client login info and get client
client = readOptions((err, opts) ->
  console.log "options: #{opts}"
#  client = new Flickr('0RjUImXvsYx2P8Gi4eZScFh9fkLJltDV', 'mbu87dOB0FWncTRJ',
#    '3XF0pqP4daZf9oIlx-a7H1uMLeGrBidkJU', 'KpslBxHoh4QYk6ad')
#  console.log "connected to client #{client}"
#  client
  null
)

api = (method_name, data, callback) ->
  # overloaded as (method_name, data, callback)
  client.createRequest(method_name, data, true, callback).send()

get_photos = ->
  params =
    user: "test"
  api('get_photos', params, (err, response) ->
    if err
      console.error("Could not upload photo:", err.toString())
    else
      # usually, the method name is precisely the name of the API method, as they are here:
      api('flickr.people.getPhotos', {
          photo_id: response.photoid
        }, (err, response) ->
        api('flickr.photosets.addPhoto', {photoset_id: 1272356126, photo_id: response.photo.id}, (err) ->
          console.log("Full photo info:", response.photo)
        )
      )
  )


exports.awesome = ->
#  get_photos()
  try
    get_photos()
  catch error
  'awesome'
{'fraction_non_alphanumeric': 0.15166795965865013, 'fraction_numerical': 0.021722265321955005, 'mean_word_length': 3.4085470085470084, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '5158126', 'n_tokens_mistral': 1007, 'n_tokens_neox': 959, 'n_words': 203}