How do I make a !bbc command

I want to make a command that get a random recent article (or just any at all, it doesnt even have to be random, it could be the first article) on Home - BBC News , but it keeps returning with “Code generation from strings disallowed for this context”.

$(eval a=$(urlfetch json https://bbc.com/news).split(";");a[Math.floor(Math.random()*a.length)])

Hey @GunnarDog!

The issue is that you fetch a webpage, and not an API. There’s only one way to fix this: use an API.

$(urlfetch https://api.scorpstuff.com/bbcnews.php)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.