Hacker News new | comments | show | ask | jobs | submit login
Use Emacs Org Mode and REST APIs for an up-to-date stock portfolio (sastibe.de)
121 points by zeveb 3 months ago | hide | past | web | favorite | 21 comments



Slightly related. I think it would be cool to be able to browse the web using org-mode. It could be very efficient.

`* google How do I walk my cat outside`

then moving cursor to that headline and pressing C-c C-c, for example, would make turn it into:

    * google How do I walk my cat outside

    ** How To Walk Your Cat On A Leash, And Why You Should | HuffPost

    ** Should You Walk Your Cat Outdoors on a Leash?

    ** Is Walking Your Cat Really a Good Idea? - Vetstreet.com

    ** How to Walk Your Cat on a Leash... Safely - Preventive Vet

    ** How to Walk a Cat (and Live to Tell About It) | petMD

    ** Can Indoor Cats Enjoy Safe Fun Outside Too? How to Keep Your Cat ...

    ** People Try Walking Their Cats - YouTube

    ** How to Walk Your Cat | Pet Training Tips

    ** How To Walk Your Cat: It's Easier Than You Think | PetSafe® Articles

    ** Train your cat to walk on a leash – Adventure Cats

Then, moving the cursor to the third result "Is Walking Your Cat Really a Good Idea? - Vetstreet.com", and pressing C-c C-c would expand it again with the main text content of the page and some important links:

    [...edited out...]

    ** Should You Walk Your Cat Outdoors on a Leash?

    ** Is Walking Your Cat Really a Good Idea? - Vetstreet.com

    *** Main content

    Q. Do you think it’s a good idea to take my cat for walks? I saw harnesses and leashes for cats at the pet supply store.

    A. That would depend very much [...edited out...]

    trying to accomplish is getting your indoor cat some access to the outside, that's probably better accomplished with a roomy cat patio.

    *** [page link][http://www.vetstreet.com/our-pet-experts/does-my-cat-need-to-go-for-walks]

    *** Read more

    *** [Cats][http://www.vetstreet.com/category/species/cats]

    *** [Veterinarian Written][http://www.vetstreet.com/category/sitecontent/veterinarian-written]

    *** [Cat Training][http://www.vetstreet.com/category/sitecontent/cat-training]

    *** [Cat Behavior][http://www.vetstreet.com/category/sitecontent/cat-behavior]

    ** How to Walk Your Cat on a Leash... Safely - Preventive Vet

    [...edited out...]


That sounds like it would be fun to write. You could even load the search results in Helm (see the end of the video below). Then selecting a result could render the page in headless Firefox (or something like elinks) and send the text output to a buffer.

https://www.youtube.com/watch?v=XjKtkEMUYGc


Emacs has shr which renders HTML natively.


emacs-w3m[1] has a lot of support for extracting structure from web pages. See the shimbun/ directory in particular.

[1] https://www.emacswiki.org/emacs/emacs-w3m


I have seen pipelines that do this. You can use `eww` https://www.gnu.org/software/emacs/manual/html_mono/eww.html and something like pandoc for on the fly html -> org mode conversion. Will look for a link


I use org-web-tools for similar functionality.

https://github.com/alphapapa/org-web-tools


You can do this kind of stuff with the Leo Editor and some scripting.


Loved his enthusiasm. I feel very much the same about emacs. It’s endless and you can easily spend most of your day in it, experimenting.

I got back to emacs few years back, than contributed to spacemacs (which is great, but also makes you forget how awesome real emacs is), now giving “emacs doom” a second look. Fascinating in a completely different way.


If you don't mind expanding a bit, what would you say to a Spacemacs user to encourage that user to explore vanilla emacs?


Spacemacs feels very abstracted. It’s great to have so much work done for you, but the knowledge is not transferable. Unless you develop layers yourself and can understand the internals, be difficult to use your knowledge outside of spacemacs.

I’ve looked at the module abstracts in doom and they don’t look foreign. They do look way above my level of emacs lisp tough.

There’s also the evil stuff in spacemacs which is great and I grew fond of, but if you’re not familiar with emacs’ native bindings, it makes it impossible to use vanilla emacs when you have too.


> There’s also the evil stuff in spacemacs which is great and I grew fond of, but if you’re not familiar with emacs’ native bindings, it makes it impossible to use vanilla emacs when you have too.

In such situations, if one cannot install spacemacs, at least they can use vim.

There's also the fact that some evil users use it because they want to edit text the vim way and not the emacs way. Such people wouldn't want to use vanilla emacs anyway.


I think that onyva might be referring to those situations where various plugins and emacs major modes require you to operate with emacs bindings, and are otherwise incompatible with vim bindings. It’s a bit rare but I’ve had to switch to emacs when trying to do some things in erc (irc client), eww (web browser), and eshell (terminal).


> Emacs is like a classical steel frame road bike, reliant, robust, nothing fancy but easy to repair.

I usually find myself comparing Emacs to the A-10 Warthog: It's big, slow, and ugly, but when you have a big ugly job it's absolutely your best friend. Also it's spent decades surviving the most determined attempts to get rid of it.

(In this analogy, Atom plays the role of the F-35 JSF: intended to replace what already exists in a variety of missions, but absolutely not mission-capable at any of them.)


I've been using the GOOGLEFINANCE function in Google Sheets for this. It works pretty well, but there are some institutional funds in my 401k without tickers, e.g. "Vanguard Institutional 500 Index Trust". Has anyone seen an API that can deal with funds like that?


For funds that track a well known index (like VFFSX), use a well known fund that tracks the same index (SPDR) and normalize the results. There will be some tracking error, but it should be small enough to not bother correcting.


Huh, neat. I threw something similar together using org-mode but calling the API via curl (because I already had that working from somewhere else). Throw the results into a table. The table contents are then used in another script to create entries for ledger-cli.

I need to fix it up because it's clunky and still requires more manual intervention than should be necessary.

I typically run it once a month (I don't care about daily prices, just end of month) using the last trading day of the month.

I may update it to use this process instead, keep it all in emacs.


Couldn't you also use this to test REST API's that you are interfacing with? Wonder if you could expand this to do stuff that postman does.


Emacs already has restclient.el[1]. Wonderful little tool. :-)

[1] https://github.com/pashky/restclient.el


I need this for crypto


There's a CRYPTOFINANCE() google sheets plugin that does a pretty good job. I've been using it the last few months.

https://chrome.google.com/webstore/detail/cryptofinance/bhjn...





Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: