made the json encoding store metadata of a paste and the fulltext
This commit is contained in:
parent
d713b509d2
commit
345f826600
1 changed files with 2 additions and 8 deletions
|
@ -126,14 +126,8 @@ class Pastebinner
|
||||||
url: @scraping_api_url + ENDPOINTS[:scrape_item_meta] + "?i=#{unique_paste_key}")
|
url: @scraping_api_url + ENDPOINTS[:scrape_item_meta] + "?i=#{unique_paste_key}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def encode_json(raw_paste_text)
|
def encode_json(raw_paste_text, raw_paste_metadata)
|
||||||
# raw_paste_text should be a RestClient response.body or a string
|
hashed_data = { "paste_metadata": raw_paste_metadata, "paste_text": raw_paste_text }
|
||||||
time = Time.new
|
|
||||||
hashed_data =
|
|
||||||
{
|
|
||||||
"date": time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
||||||
"text": raw_paste_text
|
|
||||||
}
|
|
||||||
hashed_data.to_json
|
hashed_data.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue