This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
session_start(); | |
use Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeStateFactory; | |
use Gedcomx\Rs\Client\Options\QueryParameter; | |
use Gedcomx\Rs\Client\PersonState; | |
use Gedcomx\Conclusion\Person; | |
// $personId = "KW4V-6T4"; // John Hannon | |
$personId = "KW4V-X9F"; //Jon Samsonite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
session_start(); | |
use Gedcomx\Extensions\FamilySearch\Rs\Client\FamilyTree\FamilyTreeStateFactory; | |
use Gedcomx\Rs\Client\Util\GedcomxPersonSearchQueryBuilder; | |
use Gedcomx\Rs\Client\PersonSearchResultsState; | |
use Gedcomx\Conclusion\Person; | |
if(isset($_SESSION['fs_access_token'])){ | |
$accessToken = $_SESSION['fs_access_token']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apigenb generate -s gedcomx-php/src -d gedcomx-php-docs/docs --access-levels="public" --title="gedcomx-php" --template-config="../../ThemeBootstrap/src/config.neon" --download |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use FamilySearch\Client; | |
$client = new FamilySearch\Client(array( | |
'redirectURI'=>'http://localhost:5000/familysearch-auth.php', | |
'clientId'=>'a0T3000000BfM3mEAF', | |
'collection_uri' => 'https://sandbox.familysearch.org/platform/collections' //default to the sandbox | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RootsDev | |
https://github.com/rootsdev/roots-search (Chrome Plug-in / JavaScript) | |
https://github.com/rootsdev/familysearch-javascript-sdk | |
https://github.com/rootsdev/gofamilysearch (Go FamilySearch SDK) | |
https://github.com/rootsdev/polygenea (Java and D, Collaborative Research-centric Data Model) | |
https://github.com/rootsdev/familysearch-reference-client (JavaScript/Angular, Tree Client for FamilySearch API) | |
https://github.com/rootsdev/genealogy-search (Chrome Extension) | |
https://github.com/rootsdev/people-inspector (Chrome Extension - historical-data.org microdata reader) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You have a 4 generation pedigree that you would like to extend | |
# to a 7 generation pedigree. | |
# | |
# 8 9 10 11 12 13 14 15 | |
# 4 5 6 7 | |
# 2 3 | |
# 1 | |
# | |
# If you take the person on the 4th generation and pull its pedigree, | |
# you can merge the two pedigrees to create a new larger pedigree. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def catch_authentication | |
yield | |
rescue RubyFsStack::Unauthorized => e | |
if e.message =~ /401\.23/ # Unauthorized | |
serialize_request | |
please_authenticate | |
elsif e.message =~ /401\.1/ # Bad Credentials | |
@message = "Invalid credentials. Please try again." | |
please_authenticate | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FamilySearchController < ApplicationController | |
before_filter :get_window | |
around_filter :catch_authentication | |
include FamilySearchApiHelper | |
# Internal, only for Spec purposes. | |
# get_client_test and serialize_test share behavior that will be | |
# used accross other controller actions that inherit FamilySearchController | |
def get_client_test | |
if(params[:username] && params[:password]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@relationships.sort! do |p1,p2| | |
p1_birth = p1.birth.value.date.astro.earliest.to_i | |
p2_birth = p1.birth.value.date.astro.earliest.to_i | |
p1_birth <=> p2_birth | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FS = Org::Familysearch::Ws::Familytree::V2::Schema | |
child = FS::Person.new | |
child.add_name "Jonathan /Hanson/" | |
child.add_gender "Male" | |
child.add_birth :date => "1850" | |
wife = FS::Person.new | |
wife.add_name "Rebecca /Wilson/" | |
wife.add_gender "Female" |