Jump to content

jmjeong

Member
  • Posts

    86
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by jmjeong

  1. v2.2 (2014-06-20) Launch history command (pblog) Sort option : last accessed time (^l) '!' is used to sort key too
  2. v2.1 has been released. - multiple tag search : specify tag group for searching (#) - display last modified time of local cached bookmarks - display host name only in main list - display tag information in main list too - update the number of entries in the history list after searching - display untagged bookmarks in tag list - support sort option : title ascending(`^a`), title descending(`^z`), time ascending(`^d`), time descending(default)
  3. If you add a description in note, note data is replaced with description in posts data. I need full text search for notes data. Asides from notes data, updated bookmark can only be gotten in second launch anyway in my example.
  4. This approach has one significant drawback. When I launch alfred-pinboard 20 minutes later from the last run, I got the old cache. Only after the background job is finished, I can get the fresh data. Updating bookmark is instant but updating notes can takes more time because of API request limit.
  5. Do you want that alfred-pinboard workflow invokes pinboard-download.py script in the background if cache is older than specified time? It is unclear. It needs test.
  6. Installing pinboard-download.py script is optional, and download duration is also configurable. I use alfred-pinboard more than 10-20 times per hour. I think current approach does inflict less burden than calling server per each alfred-invocation. And I need fast search speed. With regard to traffic issue, current pinboard-download.py could be updated for downloading the updated part only. In my case, 500 bookmarks is only 68k, so traffic is not big issue for the time being.
  7. I add URL to pinboard only from safari bookmarklet, not from alfred. Add to pinboard from alfred is time-consuming.
  8. pbtag syntax is [pbtag {tag} {search}]. pbtag command will show tag list in pinboard.in. After [pbtag tag] is completed, next searches bookmark in the selected tag. [Tab] key means the 'auto complete' key.
  9. I considered this option, too. But I decided the current method because of limits of API requests and fast speed of API. In my test case, it(posts/all) takes less than 1 seconds with 500 or more bookmarks and the data in pinboard site is not frequently updated. API requests are limited to one call per user every three seconds, except for the following: posts/all - once every five minutes posts/recent - once every minute Some more comments: 1. I think calling 4 requests in 1 hour does not burden server. Each API request is finished in less 1 seconds. 2. Bookmark in pinboard.in is updated only by me, so I know the bookmark is up-to date or not already. Most of time, I got the up-to-date result from cron job. In case there is stale data, I can use 'pbreload' command. 3. I think checking new-data in background can be alternative solution. I want to get most refreshed data without any delay. Without cron job, I need to wait some time until querying is finished. Actually it is short because server is enough fast. But API requests are limited, the next query must be called after 3 seconds.
  10. alfred-pinboard ver2 has been released. http://www.alfredforum.com/topic/4426-alfred-pinboard-version-2/ p.s. How can I change the title of topic in alfred forum?
  11. - GitHub Page : https://github.com/jmjeong/alfred-extension/tree/master/alfred-pinboard - Workflow Download : https://raw.githubusercontent.com/jmjeong/alfred-extension/master/alfred-pinboard/pinboard.alfredworkflow v2.3 (2016-05-20) Update Settings for Alfred v3 v2.27 Fix a bug in debug loggingv2.25 change Reload threshold time to 1 hour from 12 hours Arrange alfred layout v2.24 pblog records copy command guard code for invalid bookmark data v2.22 Launch history command (pblog) Sort option : last accessed time (^l) '!' is used to sort key too V2.1 Changelog - multiple tag search : specify tag group for searching (#) - display last modified time of local cached bookmarks - display host name only in main list - display tag information in main list too - update the number of entries in the history list after searching - display untagged bookmarks in tag list - support sort option : title ascending(`^a`), title descending(`^z`), time ascending(`^d`), time descending(default) Yet another alfred-pinboard workflow. It provides INSTANT pinboard search and the following function. search pinboard (pba) - supports various search condition such as or(|), and( ), and not(-) search tag (pbtag) search pinboard memo (pbmemo) show starred bookmark (pbs) browse and search history (pbhis) goto or delete the searched bookmark copy url of the searched bookmark send url to pocket mark or unmark the favorite bookmark InstallationDownload and Install alfred-pinboard Workflow You need to set short-key manually pbauth username:TOKEN <- set access token Get it from https://pinboard.in/settings/password pbreload - loads latest bookmarks and memo from pinboard.in search with pba, pbtag, pbmemo command (optional) pbauthpocketneeded only if you want to send URL to pocket (optional) install cron job : for faster searching without pbreloaddownload it from pinboard-download.py chmod a+x pinboard-download.py register script in crontab using crontab -e */15 * * * * /path/to/pinboard-download.py > /dev/null 2>&1 Command pba query : search query from description and link and tags pbnote query : search query from pinboard notes pbu query : search query from description(title) in unread list pbl query : search query from link pbs query : search query from starred bookmarks pbtag query : search tag list. You can autocomplete it by pressing ‘tab’ pbhis : show search history pbreload : loads latest bookmarks from pinboard.in pbauth username:token : Set pinboard authentication token (optional) pbauthpocket : Pocket authentication (optional) Search Condition- before search word stands for not ex) -program stands for and query ex) python alfred | stands for or query ex) python|alfred and query is evaluated first, than or query is evaluated KeysYou need to set it manually because of alfred restriction ctl-shift-cmd-p : launch pba ctl-shift-cmd-c : launch pbtag ctl-shift-cmd-n : launch pbnote ctl-shift-cmd-s : launch pbs ctl-shift-cmd-h : launch pbhis Action enter to open the selected url in the browser tab to expand in pbtag command Hold cmd while selecting a bookmark to copy it’s url to clipboard Hold alt while selecting to delete a bookmark from your pinboard Hold ctrl while selecting a bookmark to mark or unmark it Hold shift while selecting to send URL to pocket. You need to set auth_token using pbauthpocket help Search Tag Browse Tag Search Starred Bookmark Search History
  12. deanishe, Thank you again for your valuable comments and feedback.
  13. Andrew, v2.3(264) version seems to solve all of issues about xml parsing error. It runs flawlessly with test set. Thanks. I am happy with this release. Jaemok
  14. Your explanation makes sense to me. It explains why alfred throw parsing error irregularly. I am looking forward to pre-release. Thanks deanishe and Andrew.
  15. I see the <?xml version "1.0" encoding="utf-8"?><items> at the start line in my debug console. You can download test4 script from http://cl.ly/0m1r1G14003e/test4.alfredworkflow
  16. Nope. It doesn't work perfectly. There is 418 items in test4 output xml. It displays only 12 items. Please see debug console of test4 workflow.
  17. I agree that NSXMLParser is used by millions of people. But I am convinced that the one in alfredapp produces errors with some valid xml. I made another test workflow to test validity of xml output http://cl.ly/0m1r1G14003e. It is bash script to produces xml output, which is validated by http://validator.w3.org/check?uri=http%3A%2F%2Fs.jmjeong.com%2Faa.xml&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices Alfredapp produces ERROR: [ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 76.)'. Row 1, Col 3225: 'Opening and ending tag mismatch: title line 0 and item' in XML: I know I can add '&' in args part in xml, but alfred.py changes '&' into '&' to validate xml automatically. I should change alfred.py file to produce '&'. The code is in test-branch
  18. I don't escape anything in python, and I use the new alfred-py file. But error is the same.
  19. I changed output to 'NFD' normalisation, and tested it more. The frequency of the error is low, but the error happens again anyway. I can't help concluding that NSXMLParser in alfred app is not good for parsing the large xml data(120K). The error code is somewhat random. Actually there is no '<' in attributes values in XML. [ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 38.)'. Row 1, Col 5354: 'Unescaped '<' not allowed in attributes values' in XML: I hope the next version of alfredapp supports json format also for better compatibility. Another issue: In alfred-pinboard, I pass '&' for args field to open URL in browser. But I must escape '&' to '&' in xml, and the page does not open correctly in browser. I could find another workaround for it. But I think json format is more flexible.
  20. Thanks for your valuable comment again. Where can I get the newer version of alfred.py? I will convert the output of alfred-pinboard to 'NFD' normalization and try to use it some more time. I think it takes some time to determine if it is solved or not, because every single change of output affects xml parsing result of alfredapp.
  21. alfred-pinboard workflow is in https://github.com/jmjeong/alfred-extension/tree/master/pinboard I think adding a space to the beginning of the output is not the solution, because sometimes that output produces error and the output without space does well. I feel awkward that the result of xml parsing is random.
  22. I made three simple workflows to test this problem. To isolate xml error from other unidentified encoding issue, I make some simple script to display xml output. Test workflow link is http://cl.ly/3D3y1b0N2S0X 'test1' script displays error. [ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 5.)'. Row 1, Col 189: 'Extra content at the end of the document' in XML: 'test2' script is good. 'test2' add only one white space in the first line. 'test3' script is good. In 'test3', I added space between "</title>" and "<subtitle>" </title> <subtitle> This symptom is somewhat random. Actually most of times it is ok, but sometimes it displays error. Any comments are highly appreciated.
×
×
  • Create New...