I'm creating a website geared towards members of the Church that would
allow registered users to optionally specify their Stake/Mission and Ward/Branch.
Is there any sort of web service (REST/SOAP/XML/screen scraping) that I could use to let users pick their stake/mission and ward/branch?
Trevor
Stake and Ward API
-
- New Member
- Posts: 9
- Joined: Sat Jun 02, 2007 1:06 am
- Location: Irvine, California
- Contact:
-
- Senior Member
- Posts: 1345
- Joined: Wed Jun 11, 2008 9:52 pm
- Location: Austin TX
- Contact:
tallred wrote:I'm creating a website geared towards members of the Church that would
allow registered users to optionally specify their Stake/Mission and Ward/Branch.
Is there any sort of web service (REST/SOAP/XML/screen scraping) that I could use to let users pick their stake/mission and ward/branch?
There is no API.
The only thing I can think of is that you could make the user enter their LDS Account username and password, and log them into LUWS. Technically you then could scrape the screens to harvest the names of their units.
If all you do with the harvested data is handled client-side, that might be okay policywise. But I think harvesting anything from LUWS and storing it on your server would be coloring outside the lines.
-
- Community Administrator
- Posts: 34485
- Joined: Sat Jan 20, 2007 2:53 pm
- Location: U.S.
I'd be leery about giving my LDS Account information to a non-church server. I'd have no idea what's being done.
Have you searched the Help Center? Try doing a Google search and adding "site:churchofjesuschrist.org/help" to the search criteria.
So we can better help you, please edit your Profile to include your general location.
So we can better help you, please edit your Profile to include your general location.
- Mikerowaved
- Community Moderators
- Posts: 4740
- Joined: Sun Dec 23, 2007 12:56 am
- Location: Layton, UT
-
- New Member
- Posts: 9
- Joined: Sat Jun 02, 2007 1:06 am
- Location: Irvine, California
- Contact:
I'll have to change this as soon as the Church changes their search screen, but it works for now. Thanks Mikerowaved for the idea.
Code: Select all
public class ScreenScraper {
private static String LDS_SEARCH = "http://www.lds.org/units/find/search/1,16055,2311-1,00.html";
static public List<Account> findStakes(String unitName) {
List<Account> results = new ArrayList<Account>();
String url = LDS_SEARCH + "?unitName=" + unitName;
Source source = null;
try {
source = new Source(new URL(url));
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
if (source == null)
return results;
List<Element> allElements = source.getAllElements(HTMLElementName.A);
for (Element element : allElements) {
String link = element.getAttributeValue("href");
Account account = new Account();
account.setName(element.getContent().toString());
account.setDescription(link);
if (link.contains("secure.lds.org/units/stake")) {
account.setType(AccountType.Stake);
results.add(account);
}
if (link.contains("secure.lds.org/units/home")) {
account.setType(AccountType.Ward);
results.add(account);
}
}
return results;
}
}