URL searches?

Started by CyanGaming, August 15, 2018, 11:53:12 AM

Previous topic - Next topic

CyanGaming

Unfortunately, url searches seem to be encrypted. I was wondering if there was some kind of way to generate this? Like, turn my search parameters into this encrypted mess and then use it as a url. The search urls look like this:

index.php?action=search2;params=qJdtlksOazAQQ-_STFdeMDN5T4MgWYlWKUEJpaqAz3eo2NlCtuzJH9Pq1Jd7oXIrczoVQ1BDelANakAtcBXwCNKhQYsOPQZQBSKQcQEIqAdby8IDuAKbHSBEZrAFKlioZ3mJn9HF1xZ012s1v-enas2Ma_daDklMf3mkQf__LjT6RaPsNbul8FTcYj5tIXpNPzxTPoM.;start=30

so, is there any way I generate this link?

Arantor

This "encrypted mess" is all the parameters in the search, the terms, the boards that the search is filtered to, post age range etc.

And decrypting that has... consequences like searches not working properly, which is why it's encoded.

CyanGaming

alright, I understand that. However my question is what method is used. How do I turn search parameters into a url used for searching.

Arantor

You sit and rewrite how the search system works. And then searches won't work properly.

shawnb61

Sounds like you just want to generate your own searches?   

If they are one-offs, I'd just do the search & steal it from the URL.

If you need to automate it, I'd start by reading Sources/Search.php and looking at how $_REQUEST['params'] is utilized.  It's a mix of compression & encoding.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Arantor

See, I interpreted it as setting up to go back the other way - to see what people are searching for.

If the intent is to make bookmarkable searches or similar, literally just do the search, confined to the boards you care about and the URL is everything you need right there. Instant permalink.

I do wish people would explain what their end result is, rather than fixate on how they think they have to solve it.

CyanGaming

Quote from: Arantor on August 15, 2018, 06:00:13 PM
See, I interpreted it as setting up to go back the other way - to see what people are searching for.

If the intent is to make bookmarkable searches or similar, literally just do the search, confined to the boards you care about and the URL is everything you need right there. Instant permalink.

I do wish people would explain what their end result is, rather than fixate on how they think they have to solve it.
Apologies, I didn't mean to cause confusion. I do want to have permalinks as you said, but I also want dynamic ones. The permalinks are good for searching for flairs, but I'd also like a way for the users to click a button and search for their username, is that possible?

Arantor

Why would you have users searching for their username?

CyanGaming

to see if they've been mentioned

Arantor

As opposed to using the mentions mod to actually notify them?

CyanGaming

didn't even know that was a thing :(

Arantor

Yup, it's also a core feature in SMF 2.1.

In any case, doing it via searches is a really not good idea, because users will be hitting search often and causing a lot of load because search requires a lot of resources.

CyanGaming

ah okay, I didn't know that haha. Thanks a lot man :D

Advertisement: