News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Looking for opinions on the most efficient way to grab profile data.

Started by rcane, June 01, 2022, 05:25:36 PM

Previous topic - Next topic

rcane

I've added some custom profile fields (2.0.19) for zipcode and the +4 zip code.

I have some curl code to go to a public house.gov site and grab their rep / district / etc.

I was trying to see what would be the most efficient way to get all users' info into a separate DB/table I have.

The two methods that came to mind where to: 

1. use a cron job on the entire members table  (and themes table) or
2. somehow tie it to the "change profile" button on the user' profile page.

#1 seems like a lot of repetitive work  (unless I had mySQL ignore id_members that already have an entry)--but it's still running periodically, multiple times a day.

#2 seems cleaner because upon making a change to their profile (even if they did something small like update their avatar) the job would be small and only limited to the number of times "change profile" is pressed throughout the day (which I think would be small)

And, I'd have to manually run reports to check on the cron job method to know when to turn it off--else risk turning it off on a certain date and risk missing data.


If #2, where is the "change profile" button in order to have an 'include/magic.php' and a function called at button press?
 
I'm interested in any opinions.


vbgamer45

I would have a table with the house.gov table.

Are you linking the data via the zip code from the custom profile table in smf? Or another field?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

rcane

Quote from: vbgamer45 on June 01, 2022, 07:05:12 PMI would have a table with the house.gov table.

Are you linking the data via the zip code from the custom profile table in smf? Or another field?


No, not in the custom profile.  I was going to build a table in a separate DB and access from there.

I just wanted the php to run when they "change profile".

vbgamer45

That seems like the best way.
2. somehow tie it to the "change profile" button on the user' profile page.

Would be the best way. Its not that much work to link the data on change profile/trigger the update


For 2.0.x custom field data is updated in function makeCustomFieldChanges($memID, $area, $sanitize = true)
Sources\Profile-Modify.php(1382): // Make those changes!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: