made the json encoding store metadata of a paste and the fulltext

This commit is contained in:
booboy 2018-11-17 22:15:36 -06:00
parent d713b509d2
commit 345f826600

View file

@ -126,14 +126,8 @@ class Pastebinner
url: @scraping_api_url + ENDPOINTS[:scrape_item_meta] + "?i=#{unique_paste_key}")
end
def encode_json(raw_paste_text)
# raw_paste_text should be a RestClient response.body or a string
time = Time.new
hashed_data =
{
"date": time.strftime("%Y-%m-%d %H:%M:%S"),
"text": raw_paste_text
}
def encode_json(raw_paste_text, raw_paste_metadata)
hashed_data = { "paste_metadata": raw_paste_metadata, "paste_text": raw_paste_text }
hashed_data.to_json
end