News for hackers. Stuff that matters.
Re:Show HN: Instantly listen to any URL by eat_veggies on Friday August 13, 2021 @05:17PM (#28174647)
Is this somehow using the waybackmachine to scrape pages? When I try some of the classic ssrf paths like file:/// or http://localhost:8080, I get audio about the internet archive.

When I put in https://localhost:443, I get audio for the default nginx page, which matches what the internet archive has for that url: https://web.archive.org/web/20210620003533/http://localhost/

But putting http://localhost returns the audio from per.quest's home page.

Re:Show HN: Instantly listen to any URL by busymom0 on Friday August 13, 2021 @07:43PM (#28176237)
Not sure about OP but I just implemented this in my Hacker News android client (thanks for the idea OP).

This is how I implemented it. I had already achieved article to "reader mode" extraction by heavily customizing the Kotlin port of Mozilla‘s Readability:

https://github.com/dankito/Readability4J

From the extracted "reader mode" text, I had to do further extraction to get rid of things like image captions, author names, article publish timestamps etc. Also links had to be removed to not let the TTS engine speaking out links.

Then I pass the text via Android's TextToSpeech library and it works very well:

    fun trySpeaking(str:String){
    
        fun speak(){
            tts?.speak(str, TextToSpeech.QUEUE_FLUSH, null, null)
        }
    
        tts?.also {
            it.stop()
            speak()
        } ?: run {
            tts = TextToSpeech(appContext) { status ->
                println("Speak: $status")
                if (status == TextToSpeech.SUCCESS) {
                    speak()
                }
            }.apply {
                language = Locale.US
            }
        }
    }
If someone wants to do a tl;dr on the article text, they could pass it through SMMRY api (which the Reddit's TL;DR bot uses):

https://smmry.com

On Desktop, one can do text to speech conversion using mozilla TTS:

https://github.com/mozilla/TTS

Or Amazon Polly:

https://aws.amazon.com/polly/

For anyone wanting to give it a try, this "article to audio" will be available in tomorrow's update in my app. The reader mode is already available:

https://play.google.com/store/apps/details?id=com.pranapps.h...

Full disclaimer: I am the developer of the app and the Android version is brand new (released at 4am this morning).

Re:Show HN: Instantly listen to any URL by neolog on Friday August 13, 2021 @08:53PM (#28176727)
I really want one of these that can follow RSS/Atom feeds.
Re:Show HN: Instantly listen to any URL by hopesthoughts on Sunday August 15, 2021 @09:31PM (#28194129)
Well just download NVDA, and run it through you're RSS reader. It will read RSS feeds for you. I don't think that's what you're getting at, but it will do that, just as it does other things.
Re:Show HN: Instantly listen to any URL by busymom0 on Friday August 13, 2021 @11:53PM (#28177722)
Can you explain a bit more on your requirement? I could build something like that if I understand a bit more details.
Re:Show HN: Instantly listen to any URL by neolog on Saturday August 14, 2021 @12:03PM (#28181697)
It would be like a cross between RSS reader and podcast app. So I can listen to my favorite blogs instead of reading them. And the list would update from the RSS feed. It would probably require some text cleaning like [1] and a good text-to-speech API.

[1] https://newspaper.readthedocs.io/en/latest/

Re:Show HN: Instantly listen to any URL by busymom0 on Saturday August 14, 2021 @04:07PM (#28183578)
Thanks. I will dig further and see what I can build.
Re:Show HN: Instantly listen to any URL by ari__ on Saturday August 14, 2021 @03:41AM (#28178858)
Inoreader may provide what you're looking for!
Re:Show HN: Instantly listen to any URL by soheil on Friday August 13, 2021 @09:28PM (#28176931)
Added a check against localhost thanks for pointing that out.
Re:Show HN: Instantly listen to any URL by remram on Friday August 20, 2021 @11:43AM (#28247315)
You will not win against SSRF using a blocklist of names. You need a comprehensive solution that is designed for this and will check the end address after redirections, DNS resolutions, ... have been applied in whatever library you use for HTTP. An example is advocate for Python https://github.com/JordanMilne/Advocate
Re:Show HN: Instantly listen to any URL by karmanyaahm on Saturday August 14, 2021 @05:53PM (#28184236)
http://[::1] still works btw
Re:Show HN: Instantly listen to any URL by soheil on Saturday August 14, 2021 @08:01PM (#28185012)
Just fixed. Thanks.
Re:Show HN: Instantly listen to any URL by bryanh on Friday August 13, 2021 @11:45PM (#28177677)
Re:Show HN: Instantly listen to any URL by busymom0 on Friday August 13, 2021 @11:56PM (#28177747)
Can someone educate me on why these 2 links resolve to localhost?
Re:Show HN: Instantly listen to any URL by Zacru on Saturday August 14, 2021 @12:59AM (#28178093)
I think the first is the 32 bit int version of 127.0.0.1, and 0177 is the octal representation of 127.
Re:Show HN: Instantly listen to any URL by Zacru on Saturday August 14, 2021 @01:07AM (#28178151)
Along those lines, you can also use hex https://0x7f.0.0.0x01:443/