Setting paste name to filename (#1)

* Setting paste name to filename

* Version bump
This commit is contained in:
Tilo
2023-10-26 21:57:59 +02:00
committed by GitHub
parent daa39d1203
commit 29227ccff2
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -696,7 +696,7 @@ dependencies = [
[[package]] [[package]]
name = "pastebin-cli" name = "pastebin-cli"
version = "0.1.0" version = "0.1.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "pastebin-cli" name = "pastebin-cli"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
description = "A simple CLI for pastebin.com" description = "A simple CLI for pastebin.com"
authors = ["Tilo K"] authors = ["Tilo K"]

View File

@@ -32,13 +32,14 @@ pub async fn create_paste(
map.insert("api_paste_code", content); map.insert("api_paste_code", content);
map.insert("api_paste_private", "0".to_owned()); map.insert("api_paste_private", "0".to_owned());
map.insert("api_paste_expire_date", "1W".to_owned()); map.insert("api_paste_expire_date", "1W".to_owned());
map.insert("api_paste_name", name);
if paste_id.is_some() { if paste_id.is_some() {
let id = paste_id.unwrap(); let id = paste_id.unwrap();
map.insert("api_paste_key", id); map.insert("api_paste_key", id);
} }
let mut req = client let req = client
.post("https://pastebin.com/api/api_post.php") .post("https://pastebin.com/api/api_post.php")
.form(&map); .form(&map);