Is it possible to use api from freespace/project/profile page

+10 votes
258 views
Is it possible to use api from freespace/project/profile page.

I would like to create a link like

http://www.sdms.si:92/function/WTWeb/errors.htm?WikiTreeID=Trtnik-2,Trtnik-3,Trtnik-4,...,Dolgan-14&Generations=0

so I could show all errors of profiles on user's watchlist.

I would like to put something like this on Project page

[http://www.sdms.si:92/function/WTWeb/errors.htm?WikiTreeID={{LoggedUsersWatchList}}&Generations=0]

and on my server I would create errors list.

Not so nice solution would be to create something like FamilySearch-Match to get the watchlist, but that would require user to log in again and I don't know how to start that. I would need some help for this.
in WikiTree Tech by Aleš Trtnik G2G6 Pilot (808k points)

The FamilySearch Match tool uses the WikiTree JavaScript SDK. When your tool loads it would need to check for an existing and valid session via checkLogin(). Session data is stored in a cookie. If the user isn't logged in you would show the user a form for the username and password and then pass those to the login() method. From there you can use getWatchlist() and any of the other methods to retrieve the information you need. Does that make sense?

1 Answer

+2 votes
Hi Aleš,

FYI, two of your other requests are on the way, i.e.:

1.) Redirects for URLs such as http://www.wikitree.com/wiki/7527661

2.) On-page variables for the viewing user.

Regarding a user's Watchlist, I'm still uncomfortable with the idea of passing it through a URL, but I haven't really investigated.

If you're amenable to doing this on the apps server, that would be my preference since we're already set up to do it. I'll ask Justin York if he can help with the login page.

Chris
by Chris Whitten G2G Astronaut (1.5m points)

Cool. Looking forward to use it. 

1.) Will remove a few dead end links.

2.) That will be nice link for project page. Magnus created template to {{db_errors}} to put on profile and have link to errors for that profile and connected ones. Check documentation for this template.

    But a few new things appeared as wishes.

    3.) WatchList: To see errors for watch list. I hope Justin York can help me with that.

    4.) Profile manager. To see in error report if profile has one. In case of multiple managers, one is enough.

    5.) Categories on profiles: To add error Unmanaged profile. I would need quick DL of Unsourced 164 141 members.

    6.) Update of database dump fields. On edit page and in API, there are a lot of fields, that are not part of the dump. Probably fields weren't updated for a few years.

    Regards Aleš

    Hi Aleš,

    #4 is part of #6, right?

    What else do you have in mind with #6? What specific fields would you like to see included?

    Regarding #5, a user can view the unsourced profiles on their Watchlist by limiting the category display. I can see why it would be nice to also see unsourced profiles on an error report, but if this is the only reason you need a category API it doesn't seem like a high priority to me. Is there something I'm missing, or other uses you have in mind?

    Chris

    Thx #1

    #6 Well I did first name validation (separators, spelling, gender) and dealing with one field with prefix + name + middle initials + nickname was quite complex. It would be much easier for me if i would validate those fields separated, as they are entered. I could also use certainty field when sampling the database and give certain name more importance.

    #5 I think they want to see unsourced dutch profiles. If I could import category members, it would be possible to support various project with all errors limited to project by category like The Dutch Cape Colony 1652-1806

    Bad news on #2: It's going to be harder to provide user variables than we expected. It's a caching problem. We would have to change our caching system to make this work. It's possible, but not easy. I'd like to wait and see how important this this turns out to be and if other needs for the user variable arise.

    I'll look into #5, the category dumps. I can see how that would be really great for projects.

    Regarding #6, the additional database fields, a complication is that other people and organizations use the database dump. I recall now that the concatenation was specifically requested. We could just add extra columns and tell the other users to ignore them. How important do you think this area of data validation is?

    Thanks!
    #2 It isn't so important, since we solved this with template. There will be no automatic link on project page for user to see his errors. Alternative would be to put such link in navigation menus (maybe even better), since this is getting wider use day by day. In navigation you probably have this possibility.

    #6 I would like all fields as they are entered. I don't think size and server load is a problem. It is all done in 15 minutes. To reduce size also text like gender and date precision  could be number 0, 1 and 2 like privacy. File would be smaller and also for me that is useful.

    #2: Yes, we should put this on the navigation menu! I'm not sure if it would best belong under My WikiTree or Find, and be for the user only, or if it should be under the profile menu and be for the profile you're viewing (which could be your own).

    #6: We'll get you your own dump if we have to. I want to keep you rolling!

    On that, I don't suppose you'd be interested in the full text of profiles, i.e. the bio/sources section? It would be a huge amount of data.

    This would open up the possibility of scanning for spelling and grammar errors, though I have no idea how you would do that. With the possibility of bios being in multiple languages and including personal names, it might be impossible. But there might be other things you would think up, like formatting problems.

    I would have a separate reason for wanting you to hold a copy of the text of profiles. It would be an extra back-up. And because you're not a WikiTree employee, it would help us guarantee that WikiTree would be free forever. If WikiTree ever disappeared or a successor organization violated the pledge to keep WikiTree free, you could release your copy. (Otherwise you'd have to keep it private, for the same reasons explained in the Permissions and Restrictions section of the database dumps page.)

    I can look into how many GB this would be if you want to talk about it further.

    #2 I think profile menu would be good, so you could start tree with any profile.

    #6 Bio is a bigger thing. I don't think I could include it into my DB directly, but could just scan it for categories, references, or something else. I guess it is around 20Gb. Having my own dump is ok with me. It can be easier to change something. I can commit to being 3rd party backup and would find a way to reshare the data in case of Who knows.

    #7 I wrote API app in JS to get user's watchlist and send it to my server to get all errors for it, but it is kind of slow. 30s for 3K profiles and 2Mb JSON. That would be 1 minute for 5K profiles and probably also huge load on APPS server. Could getWatchlist be extended to specify which fields to return. I need only ID. You can try it on https://apps.wikitree.com/apps/trtnik2/ex/
    #2, the menu changes, might be live today. A whole list of other changes to the menus were overdue so I used this excuse to prioritize it.

    Regarding #6 and #7, I'll work on these. I'll be traveling from Thursday to Tuesday so we won't be likely to get you anything for at least a week, though. Thanks for all you're doing, Aleš. It's fantastic.
    Regarding #7, from Brian:

    "A significant amount of the delay is just from the watchlist query itself, which can be intensive for large watchlists. However, I’ve added a 'fields' parameter option to the getWatchlist() function of the API. By default, the full set of (allowed) profile fields is returned, but if 'fields' is set, then only those fields (again, as allowed) are part of the returned data. This will significantly reduce the size of the return if he’s only looking for the IDs. The 'fields' parameter is just a comma-delimited string of the field names, as with getPerson()."

    This should be live. Let me know if it works. Thanks!
    #7 It works very fast. 3K profiles instantly. Is 5K maximum profiles number in WatchList? What next? Do I just publish this URL https://apps.wikitree.com/apps/trtnik2/WatchListErrors.htm or is it anything else?
    Great!

    There is no technical limit on Watchlists. It's strongly recommended that they don't exceed 5K, but some do.

    Publishing the URL on the project page and wherever else seems like a good idea. If someone clicks over from the Error Report link on the pull-down menu to the project page, they can see how they can get a report for just their Watchlist.

    Related questions

    +2 votes
    1 answer
    139 views asked Jan 25 in WikiTree Tech by Tomáš Kratina G2G2 (2.2k points)
    +5 votes
    1 answer
    +6 votes
    2 answers
    156 views asked Jan 8 in WikiTree Tech by Michel Vorenhout G2G6 Pilot (316k points)
    +7 votes
    2 answers
    +9 votes
    3 answers
    233 views asked Sep 28, 2022 in WikiTree Tech by Przemek Więch G2G5 (5.2k points)
    +7 votes
    3 answers
    217 views asked Feb 1, 2022 in WikiTree Tech by Fairch Fairchild G2G2 (3.0k points)
    +5 votes
    1 answer
    +7 votes
    1 answer
    336 views asked Jan 19, 2022 in WikiTree Tech by Ken McEvoy G2G6 Mach 1 (12.1k points)
    +26 votes
    2 answers

    WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

    disclaimer - terms - copyright

    ...