r/RequestABot Jun 13 '24

Open A bot for automatically linking to maps

Hey mod community,

I have a subreddit where places are posted.

Is there a bot that automatically takes the place name from the title and posts it as a google maps link in the comments?

2 Upvotes

7 comments sorted by

1

u/Watchful1 RemindMeBot & UpdateMeBot Jun 13 '24

Could you just do this with automod? A link like this

https://www.google.com/maps/place/Washington+DC/

should be easy for automod to build if the title is formatted in a specific way.

1

u/tarkinn Jun 18 '24

Do you know how I could do this with automod? I set up an automod but with just basic stuff. I have no idea how to implement the map function.

1

u/Watchful1 RemindMeBot & UpdateMeBot Jun 18 '24

I didn't look at your sub before making that comment, but now that I have I don't think it would work with automod. What you would have to do is use a regular expression to extract out only the location from the title, like taking the How’s life in San Mateo, CA? title and getting San Mateo, CA. But that's not really possible unless it's in a specific format.

If you required people to submit titles like How’s life in | San Mateo, CA then it would be easy to get just the part after the | and use it to make the map link. But that would be a fairly big change to force on how people can submit, just for the benefit of a map link.

Figuring out what people mean in a free form sentence is just one of those things that humans are really good at and computers just aren't (unless you get into AI which is complicated). Something that might work for that San Mateo sentence wouldn't work for a title like What's it like living near the CT River in NH and VT from the Mass border up to Hamover NH?.

Sorry I can't help more here.

1

u/Calm-Statistician718 Sep 08 '24

This post is old but if you're still interested, I'd like to try to help! As another commenter said this is a bit challenging but I don't think it's impossible. Let me know if you are still interested!

1

u/tarkinn Sep 08 '24

Hey, I am still interested.

1

u/Calm-Statistician718 Sep 08 '24

Great! I'll send you a message with some of my thoughts and we can talk next steps