View previous topic :: View next topic |
Author |
Message |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Wed Apr 01, 2020 12:17 pm Post subject: [Solved]News script for eggdrop bot by m00nie |
|
|
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 |
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Wed Apr 01, 2020 5:36 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Thu Apr 02, 2020 12:37 pm Post subject: Variable |
|
|
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!  |
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Thu Apr 02, 2020 4:04 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Fri Apr 03, 2020 9:01 am Post subject: Only default source |
|
|
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.  |
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Fri Apr 03, 2020 4:35 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
|
Back to top |
|
 |
shahrul Voice
Joined: 06 Mar 2005 Posts: 27
|
Posted: Sat Apr 11, 2020 6:57 am Post subject: |
|
|
Hi,
Seem throttlecheck too fast. how can i increase?
does the tcl auto post if new news is posting?
Quote: | [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 |
|
|
Back to top |
|
 |
m00nie Voice
Joined: 28 Mar 2020 Posts: 14
|
Posted: Sun Apr 12, 2020 3:54 am Post subject: |
|
|
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 |
|
Back to top |
|
 |
Dominatez Halfop

Joined: 14 Jan 2019 Posts: 46 Location: United Kingdom
|
Posted: Sun May 24, 2020 8:21 pm Post subject: |
|
|
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?country=gb&apiKey=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" |
|
Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 394
|
Posted: Wed Nov 11, 2020 10:28 am Post subject: |
|
|
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=e3475de99399b361&name=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  _________________ ComputerTech |
|
Back to top |
|
 |
digitized Voice
Joined: 04 Sep 2022 Posts: 2
|
Posted: Tue Sep 06, 2022 9:13 am Post subject: !news command |
|
|
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 |
|
Back to top |
|
 |
|