-
Notifications
You must be signed in to change notification settings - Fork 52
Project
Bryan edited this page Dec 18, 2022
·
7 revisions
Name | Type | Description |
---|---|---|
id | Integer | |
name | String | |
slug | String | |
blurb | String | |
goal | Float | |
pledged | Float | |
state | String | a string of 'submitted' (waiting to go live), 'live', 'successful', 'failed', 'suspended', 'deleted', or 'canceled' |
currency | String | ISO code of the currency type |
currency_symbol | String | |
deadline | Datetime | |
state_changed_at | Datetime | when the project met it's goal? |
photo | Object | contains references to full , med , small and little images for the project |
creator | User | a User object of the creator. |
location | [[Location | Location]] |
urls | Object | contains references to related web and api urls |
is_starred | Boolean | true if starred by the authenticated user |
is_backing | Boolean | true if backed by the authenticated user |
launched_at | Datetime | |
updated_at | Datetime | |
country | String | ISO Code of the country the project is from |
video | Object | contains height, width, and links to different formats of the video. |
backers_count | Integer | |
friends | Users | Probably an array of authenticated user's friends that have backed this too? |
country_short_name | String | |
country_long_name | String | |
comments.count | Integer | |
updates.count | Integer | |
last_update_published_at | Datetime | |
rewards | [[Rewards | Reward]] |
embed | Object | An object with a card containing HTML for an iFrame. |
=begin
https://github.com/markolson/kickscraper
This script pulls out the project goal, pledged amount, and the number of backers, and writes it to a text file for use in other tools. Specifically written for use with streaming software.
Nav to the script dir, run this command:
ruby kickscrape.rb 'project name'
=end
require 'kickscraper'
Kickscraper.configure do |config|
config.email = nil
config.password = nil
config.proxy = nil
end
c = Kickscraper.client
proj = c.search_projects(ARGV).first
if proj.empty?
p "Unable to find project!"
else
p "Found project!"
p proj.name
p "Goal: $" + proj.goal.to_s + "0"
if proj.state == 'live'
while true
time = Time.new
puts time.strftime("%Y%m%d %H:%M:%S")
proj.goal
goal = proj.goal.to_s + "0"
proj.pledged
p "Pledged: $" + proj.pledged.to_s.chomp(".0")
p "Backers: " + proj.backers_count.to_s
backers = "Backers: " + proj.backers_count.to_s
File.open("backercount.txt", "w") { |f| f.write "#{backers}" }
pledged = proj.pledged
pledged = pledged.to_s.chomp(".0")
File.open("pledged.txt", "w") { |f| f.write "#{proj.currency_symbol}#{pledged} / #{proj.currency_symbol}#{goal}" }
sleep 120
end
else
p "Project not live!"
p proj.state.to_s
end
end