egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Solved]News script for eggdrop bot by m00nie

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Wed Apr 01, 2020 12:17 pm    Post subject: [Solved]News script for eggdrop bot by m00nie Reply with quote

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
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Wed Apr 01, 2020 5:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Thu Apr 02, 2020 12:37 pm    Post subject: Variable Reply with quote

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! Smile
Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Thu Apr 02, 2020 4:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Fri Apr 03, 2020 9:01 am    Post subject: Only default source Reply with quote

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. Smile
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. Smile
Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Fri Apr 03, 2020 4:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Sat Apr 04, 2020 4:45 am    Post subject: Reply with quote

The script works thank You for your work m00nie!
Cheers

https://www.m00nie.com/news-script-for-eggdrop-bot/
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Sat Apr 11, 2020 6:57 am    Post subject: Reply with quote

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
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Sun Apr 12, 2020 3:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Dominatez
Voice


Joined: 14 Jan 2019
Posts: 36
Location: United Kingdom

PostPosted: Sun May 24, 2020 8:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 374

PostPosted: Wed Nov 11, 2020 10:28 am    Post subject: Reply with quote

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 Cool
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber