This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

[Solved]News script for eggdrop bot by m00nie

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

[Solved]News script for eggdrop bot by m00nie

Post by m4s »

Hi,

The script: https://pastebin.com/mi2trB9t

I would like to use this script but when I try to set a page as a source - for example !setnews Thesun.co.uk - I get this error message in DCC:
Tcl error [m00nie::news::source]: error flushing "sock55a54eafc0f0": software caused connection abort

Can someone have a look?

Thanks a lot!
Last edited by m4s on Sat Apr 04, 2020 4:46 am, edited 1 time in total.
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

Hey m4s

New update (2.0) moved to the new API and 'sorted' the TLS errors I hope due to the move to cloudflare and need for SNI plus my TLS config seems a bit old/rubbish for more modern Https
Hopefully all good now 😁
Cheers


m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Variable

Post by m4s »

m00nie wrote:Hey m4s
New update (2.0) moved to the new API and 'sorted' the TLS errors I hope due to the move to cloudflare and need for SNI plus my TLS config seems a bit old/rubbish for more modern Https
Hopefully all good now 😁
Cheers
m00nie
Hi m00nie!

The error message is:
Tcl error [m00nie::news::source]: can't read "ALL": no such variable

Thanks for your work & Cheers! :)
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

Hopefully all fixed in v2.1 ....V2 was.... not great (I think the technical term is utter [censored] I didn't test fully or at all for some cases)....

I hadn't actually realised that the V2 API is more geographically based than specific news source. V2.1 reflects that and now reports latest stories in a country

Cheer

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Only default source

Post by m4s »

m00nie wrote:Hopefully all fixed in v2.1 ....
Yes, you did a great job thanks! The script works!

But there is a question as the bad users always have. :)
I don't want let the users to choose the source but I want to set a default source in the script (for example: gb) and everyone get the news on this language what to change?

Thanks and I promise this is my last question. :)
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

v2.2 adds the option to set a default location and will use that if no per user location is saved (just comment out the setnews line to stop people doing that 😝)
Realised i didn't share a link for anyone else but https://www.m00nie.com/news-script-for-eggdrop-bot/

Cheers

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

The script works thank You for your work m00nie!
Cheers

https://www.m00nie.com/news-script-for-eggdrop-bot/
s
shahrul
Voice
Posts: 27
Joined: Sun Mar 06, 2005 8:52 am

Post by shahrul »

Hi,

Seem throttlecheck too fast. how can i increase?

does the tcl auto post if new news is posting?
[19:37:35] <noob> !news
[19:37:37] <+android> No default news source found for you. Please set one using !setnews or specify a default source
[19:37:44] <noob> !setnews my
[19:37:45] <+android> set default news region to Malaysia (my)
[19:37:48] <noob> !news
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

Hi shahrul

There are some hopefully commented to be clear variables near the top of the script to control the throttle timers. Just change those to what suits you 😁
Updating with new news migjt be more than a little noisy but I'll have a look and see how that might work
Cheers

m00nie
User avatar
Dominatez
Halfop
Posts: 50
Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom

Post by Dominatez »

Do you have a link to a working version of

OLD Version of TLS package installed please update to 1.7.11+

As i keep getting the following error.

Tcl error [m00nie::news::search]: invalid command name "json::many-json2dict"

UPDATE : Updated My Box to Ubuntu 19.10 today, and still no Joy. Still showing the same error.

Don't know if this will help you.

<Tr33fooTom> [17:31:28] m00nie::news::search is running
<Tr33fooTom> [17:31:28] m00nie::news::search ..... something odd happened
<Tr33fooTom> [17:31:28] m00nie::news::search Grabbing news for Dominatez, with source of gb and name of United Kingdon
<Tr33fooTom> [17:31:28] m00nie::news::getinfo grabbing: http://newsapi.org/v2/top-headlines?cou ... ey=BLANKED OUT
<Tr33fooTom> [17:31:28] m00nie::news::getinfo Rawpage length is: 15953
<Tr33fooTom> [17:31:28] Tcl error [m00nie::news::search]: invalid command name "json::many-json2dict"
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Dominatez, have you tried loading the json package?

Seems to me, you don't have the json package loaded, try the following.


If you have ROOT, do, sudo apt-get install tcl tcl-dev

if Not, https://core.tcl-lang.org/tcllib/dir?ci ... me=modules

And find json

then pop that json.tcl in your eggdrop scripts directory,
and put source scripts/json.tcl into your eggdrop.conf

Hope this helps 8)
ComputerTech
d
digitized
Voice
Posts: 2
Joined: Sun Sep 04, 2022 11:10 am

!news command

Post by digitized »

Hello, a (little) question: Is it possible to use a command like:

!news NL
or
!news US

Insteed of setting each time a new country code using:

!setnews <countrycode>

Since the channel the bot is in got a lot various nationalities joined.
Is that possible?
Any help or suggestions are welcome.
Thanks in advance
Post Reply