spamwax / alfred-pinboard-rs

Alfred Workflow for Pinboard (Rust)
Other
278 stars 13 forks source link

Error in parsing of bookmark payload #22

Closed aneng closed 5 years ago

aneng commented 5 years ago

Hi,

If I try to save a bookmark with "p tag1...." I´ll get an error message and currently I have no clue how to handle it. Same when I try to search a bookmark Setting the auth token was no problem.

System: macOS 10.14.1 Workflow: 0.14.3

Log: Starting debug for 'Rusty Pin'

[2018-11-20 21:55:31][input.scriptfilter] Queuing argument '' [2018-11-20 21:55:38][input.scriptfilter] Script with argument '' finished [2018-11-20 21:55:38][ERROR: input.scriptfilter] Code 1: DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs: Parsing input arguments. DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs: Deciding on which command branch DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs: Starting in setup DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs::workflow_config: Starting in setup DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs::workflow_config: Starting in get_workflow_dirs DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs::workflow_config: Starting in read DEBUG 2018-11-20T20:55:31Z: alfred_pinboard_rs::workflow_config: Starting in get_alfred_version DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard: pinb::new: calling CachedData::new DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: new: starting DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: cached_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: create_cache_dir: starting DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: success create_cache_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: load_cache_data_from_file: starting DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: cache_ok: starting DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard: pinb::new: cache file missing, calling update DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::cached_data: update_cache: starting DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::api: all_pins: starting. DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::api: get_api_response: starting. DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::api: url: "https://api.pinboard.in/v1/posts/all" DEBUG 2018-11-20T20:55:31Z: rusty_pin::pinboard::api: add_auth_token: starting. DEBUG 2018-11-20T20:55:33Z: rusty_pin::pinboard::api: resp is ok (no error) DEBUG 2018-11-20T20:55:38Z: rusty_pin::pinboard::api: string from resp ok DEBUG 2018-11-20T20:55:38Z: rusty_pin::pinboard::api: received all bookmarks DEBUG 2018-11-20T20:55:38Z: alfred_pinboard_rs: Starting in show_error_alfred [2018-11-20 21:55:38][input.scriptfilter] {"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]} [2018-11-20 21:55:41][input.scriptfilter] Queuing argument 'T' [2018-11-20 21:55:41][input.scriptfilter] Queuing argument 'Te' [2018-11-20 21:55:42][input.scriptfilter] Queuing argument 'Tes' [2018-11-20 21:55:42][input.scriptfilter] Queuing argument 'Test' [2018-11-20 21:55:43][input.scriptfilter] Queuing argument 'Test+' [2018-11-20 21:55:44][input.scriptfilter] Queuing argument 'Test' [2018-11-20 21:55:44][input.scriptfilter] Script with argument 'T' finished [2018-11-20 21:55:44][ERROR: input.scriptfilter] Code 1: DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs: Parsing input arguments. DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs: Deciding on which command branch DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs: Starting in setup DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs::workflow_config: Starting in setup DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs::workflow_config: Starting in get_workflow_dirs DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs::workflow_config: Starting in read DEBUG 2018-11-20T20:55:41Z: alfred_pinboard_rs::workflow_config: Starting in get_alfred_version DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard: pinb::new: calling CachedData::new DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: new: starting DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: cached_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: create_cache_dir: starting DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: success create_cache_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: load_cache_data_from_file: starting DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: cache_ok: starting DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard: pinb::new: cache file missing, calling update DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::cached_data: update_cache: starting DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::api: all_pins: starting. DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::api: get_api_response: starting. DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::api: url: "https://api.pinboard.in/v1/posts/all" DEBUG 2018-11-20T20:55:41Z: rusty_pin::pinboard::api: add_auth_token: starting. DEBUG 2018-11-20T20:55:43Z: rusty_pin::pinboard::api: resp is ok (no error) DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: string from resp ok DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: received all bookmarks DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs: Starting in show_error_alfred [2018-11-20 21:55:44][input.scriptfilter] {"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]} [2018-11-20 21:55:44][input.scriptfilter] Processing output of 'utility.junction' with arg '' [2018-11-20 21:55:44][utility.junction] Processing output of 'utility.filter' with arg '' [2018-11-20 21:55:44][utility.filter] Processing output of 'action.script' with arg '' [2018-11-20 21:55:44][utility.junction] Processing output of 'utility.filter' with arg '' [2018-11-20 21:56:00][ERROR: action.script] DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs: Parsing input arguments. DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs: Deciding on which command branch DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs: Starting in setup DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs::workflow_config: Starting in setup DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs::workflow_config: Starting in get_workflow_dirs DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs::workflow_config: Starting in read DEBUG 2018-11-20T20:55:44Z: alfred_pinboard_rs::workflow_config: Starting in get_alfred_version DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard: pinb::new: calling CachedData::new DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: new: starting DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: cached_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: create_cache_dir: starting DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: success create_cache_dir: "/Users/alex/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/cc.hamid.alfred-pinboard-rs" DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: load_cache_data_from_file: starting DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: cache_ok: starting DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard: pinb::new: cache file missing, calling update DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::cached_data: update_cache: starting DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: all_pins: starting. DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: get_api_response: starting. DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: url: "https://api.pinboard.in/v1/posts/all" DEBUG 2018-11-20T20:55:44Z: rusty_pin::pinboard::api: add_auth_token: starting. DEBUG 2018-11-20T20:55:53Z: rusty_pin::pinboard::api: resp is ok (no error) DEBUG 2018-11-20T20:55:59Z: rusty_pin::pinboard::api: string from resp ok DEBUG 2018-11-20T20:55:59Z: rusty_pin::pinboard::api: received all bookmarks DEBUG 2018-11-20T20:55:59Z: alfred_pinboard_rs: Starting in show_error_alfred [2018-11-20 21:56:00][action.script] Processing output of 'utility.junction' with arg '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]}' [2018-11-20 21:56:00][utility.junction] Processing output of 'utility.filter' with arg '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]}' [2018-11-20 21:56:00][utility.junction] Processing output of 'utility.filter' with arg '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]}' [2018-11-20 21:56:00][utility.junction] Processing output of 'utility.filter' with arg '{"items":[{"icon":{"path":"erroricon.icns"},"subtitle":"expected value at line 1562 column 1","title":"Error"}]}'

Cheers Alex

spamwax commented 5 years ago

Hi Alex,

Based on your log, it seems either one of your bookmarks' url has a wrong format (or maybe a wierd character in title/description). This seems to be similar to issue #1.

You can get all your bookmarks like this:

curl https://api.pinboard.in/v1/posts/all\?format\=json\&auth_token\=your_username:api_token > bookmarks.json

and then check the bookmarks.json around line 1562 and see if you can spot the issue. If you don't mind, you can share that json file with me and I can also take a look at it.

Let me know how it goes.

aneng commented 5 years ago

Hi,

sorry for delay, I´m currently a bit busy.

I´ve grab the bookmark.json and found this around line 1562: The "," on Line 1565 and 1568 looking strange for me, but I´ve no clue how to get rid of them...

1564 {"href":"http:\/\/www.viertlerhof.it\/index.php","description":false,"extended":"","meta":"21ee7c46dba02efb6e7a3dc65a76fcca","hash":"17d3a9c1a88fe13882e51b2819e79525","time":"2011-01-01T17:39:54Z","shared":"yes","toread":"no","tags":"Urlaub Italien Skifahren Meran Wellness"}, 1565 , 1566 {"href":"http:\/\/uebungen-online.de\/home.html","description":"MaxxF Krafttraining","extended":"","meta":"b015c55eda143f30bf89061204e860fa","hash":"245ed6a70242cfe0ebd0342589da2c6e","time":"2010-12-25T16:06:28Z","shared":"yes","toread":"no","tags":"MaxxF Training Kraftausdauer Kraft Stabi \u00dcbungen"}, 1567 {"href":"http:\/\/feedproxy.google.com\/~r\/webkrauts\/iXSU\/~3\/G2c4rGMZJDI","description":"Schatten werfen mit CSS3","extended":"","meta":"570ce65a7b06d1c60f198a5f9a703c60","hash":"f7165642c3e1912b44da47200e2c05f2","time":"2010-12-24T09:08:49Z","shared":"yes","toread":"no","tags":"Workaround CSS Webdesign Webentwicklung Website"}, 1568 , 1569 {"href":"http:\/\/feedproxy.google.com\/~r\/webkrauts\/iXSU\/~3\/.......

Any ideas from your side?

Cheers Alex

spamwax commented 5 years ago

it seems that you have created empty bookmark on Pinboard (no title, no url,...). The only way to make this workflow work at the moment is to find those on Pinboard.in and delete them.