Giter Site home page Giter Site logo

lds-org's People

Contributors

jidn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lds-org's Issues

Auto filling of %@ won't work for all endpoints.

Most endpoints use %@ as a marker for unit number, but not all. This really messes up the logic (see issue #3)

Go through the endpoint and turn all % markers into {}, {unit}, or {member} variables. This will allow people to better understand endpoints.

Change the display of endpoints to see the URL

Missing file VERSION

After I installed I got no such file or directory: 'path/to/site-packages/VERSION'

Initial setup issues [MacOS, Python2, Python3]

First I did as suggested (assuming, that python is 2.x)

pip install lds-org
Collecting lds-org
  Downloading LDS_org-0.2.0-py2-none-any.whl
Collecting certifi (from lds-org)
  Using cached certifi-2017.11.5-py2.py3-none-any.whl
Collecting requests (from lds-org)
  Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->lds-org)
  Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests->lds-org)
  Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests->lds-org)
  Using cached urllib3-1.22-py2.py3-none-any.whl
Installing collected packages: certifi, chardet, idna, urllib3, requests, lds-org
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/certifi-2017.11.5.dist-info'

I have a few projects using Python 2 and not sure, but it requires sudo, so I did:

sudo pip install lds-org
Password:
The directory '/Users/alund/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/alund/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting lds-org
  Downloading LDS_org-0.2.0-py2-none-any.whl
Collecting certifi (from lds-org)
  Downloading certifi-2017.11.5-py2.py3-none-any.whl (330kB)
    100% |████████████████████████████████| 337kB 2.1MB/s 
Collecting requests (from lds-org)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 7.0MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests->lds-org)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 5.9MB/s 
Collecting idna<2.7,>=2.5 (from requests->lds-org)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 7.7MB/s 
Collecting urllib3<1.23,>=1.21.1 (from requests->lds-org)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |████████████████████████████████| 133kB 6.5MB/s 
Installing collected packages: certifi, chardet, idna, urllib3, requests, lds-org
Successfully installed certifi-2017.11.5 chardet-3.0.4 idna-2.6 lds-org-0.2.0 requests-2.18.4 urllib3-1.22

Looks like installed. And I assumed for 2.x version, due to /Library/Python/2.7/site-packages/...

In Chrome browser I was NOT logged in.

python -m lds_org
LDS.org username:alundiak
LDS.org password:

And I received:

<!-- <Response [200]> -->
<!-- https://www.lds.org/denied.html -->
<!DOCTYPE HTML>
<html><head>        
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<link type="text/css" href="error.css" rel="stylesheet">
<title>Access Denied</title>
</head>
<body id="error-page">
  <div class="supercenter">
   <h1>Access Denied</h1>
    <p>You are not authorized to access this page.</p>
  <div style="border-top: 1px solid rgb(221, 221, 221);">
  <p>
   <img src="logo_black.gif">
  </p>
  </div>
  </div>
</body>
</html>

I logged in as valid username and pass in Chrome browser, and then get back to Terminal.
But trying connect was again Denied.

Then I decided to install lds-org for Python 3.

pip3 install lds-org           
Collecting lds-org
  Downloading LDS-org-0.2.0.tar.gz
Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from lds-org)
Requirement already satisfied: certifi in /usr/local/lib/python3.6/site-packages (from lds-org)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests->lds-org)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests->lds-org)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests->lds-org)
Building wheels for collected packages: lds-org
  Running setup.py bdist_wheel for lds-org ... done
  Stored in directory: /Users/alund/Library/Caches/pip/wheels/56/da/87/0453d972d70ac5abbb9492ef2f4cb8e337383bc98460db7b80
Successfully built lds-org
Installing collected packages: lds-org
Successfully installed lds-org-0.2.0

It's installed => /usr/local/lib/python3.6/site-package

Then I run:

$python3 -m lds_org                   
/usr/local/bin/python3: No module named lds_org

My python3 (usr/local/bin/python3) points to /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
No idea why, but ok... Will troubleshoot later... Most probably related with $PATH.

And then, I run old command again:

python -m lds_org 
LDS.org username:alundiak
LDS.org password:

And I received:

[action-and-interview-list] https://www.lds.org/mls/mbr/services/report/action-interview-list/unit/{unit}/?lang=eng
[action-and-interview-list-full] https://www.lds.org/mls/mbr/services/report/action-interview-list/full/unit/{unit}/?lang=eng
[android-faq-url          ] http://www.lds.org/callings/melchizedek-priesthood/records-and-technology-support/lds-tools-faq?lang=eng
[android-latest-location  ] https://play.google.com/store/apps/details?id=org.lds.ldstools
[android-release-notes-url] https://www.lds.org/callings/melchizedek-priesthood/records-and-technology-support/lds-tools-release-notifications?lang=eng#android
[auth-url                 ] https://signin.lds.org/login.html
[birthday-list            ] https://www.lds.org/mls/mbr/services/report/birthday-list/unit/{unit}/?month=1&months=12&organization=selectAll&lang=eng
[cal-event                ] https://wsmobile1.lds.org/CP/CalendarProxyService/v1/Event/{}
[cal-events               ] https://wsmobile1.lds.org/CP/CalendarProxyService/v1/Events/{}-{}
[cal-subscribed           ] https://wsmobile1.lds.org/CP/CalendarProxyService/v1/Subscribed
[cal-version              ] https://wsmobile1.lds.org/CP/CalendarProxyService/v1/Locations?blah=adm/appVersion
[cal2x-colors             ] https://www.lds.org/mobilecalendar/services/lucrs/cal/allColors
[cal2x-event              ] https://www.lds.org/mobilecalendar/services/lucrs/evt/{}
[cal2x-events             ] https://www.lds.org/mobilecalendar/services/lucrs/evt/calendar/{}-{}
[cal2x-init               ] https://www.lds.org/mobilecalendar/services/lucrs/mem/currentUserOptions/{}
[cal2x-locations          ] https://www.lds.org/mobilecalendar/services/lucrs/loc/locations
[cal2x-set-calendar-color ] https://www.lds.org/mobilecalendar/services/lucrs/cal/{}/color/{}/
[cal2x-status             ] https://www.lds.org/mobilecalendar/heartbeat
[cal2x-subscribed         ] https://www.lds.org/mobilecalendar/services/lucrs/cal/subscribed
[callings-with-dates      ] https://www.lds.org/mls/mbr/services/report/members-with-callings?unitNumber={unit}&lang=eng
[current-user-detail      ] https://www.lds.org/mobiledirectory/services/v2/ldstools/current-user-detail
[current-user-id          ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/current-user-id
[current-user-unit        ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/current-user-unitNo
[current-user-units       ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/unit/mobile/current-user-units
[current_user_id          ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/current-user-id
[directory-status         ] https://www.lds.org/mobiledirectory/heartbeat
[feedback                 ] https://lds.qualtrics.com/SE/?SID=SV_esOCWpQ67JUc6na
[ios-eng-support-rss-url  ] http://www.ldsmobile.org/lt-ios-help/?feed=rss2
[ios-faq-url              ] http://www.lds.org/callings/melchizedek-priesthood/records-and-technology-support/lds-tools-faq?lang=eng
[ios-release-notes-url    ] https://www.lds.org/callings/melchizedek-priesthood/records-and-technology-support/lds-tools-release-notifications?lang=eng#ios
[leader-access            ] http://tech.lds.org/mobile/ldstools/leader-access-1.0.json
[member-assignments       ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/member-assignments
[members-moved-in         ] https://www.lds.org/mls/mbr/services/report/members-moved-in/unit/{unit}/{}?lang=eng
[membership-record        ] https://www.lds.org/mls/mbr/services/report/membership-record/{member}?lang=eng
[membership-records       ] https://www.lds.org/mls/mbr/services/report/membership-records?unitNumber={unit}&lang=eng
[organization-list-url    ] http://tech.lds.org/mobile/ldstools/lists.json
[photo-base-url           ] https://www.lds.org
[photo-url                ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/photo/url/{member}/{}
[privacy-url              ] http://www.lds.org/legal/privacy?lang=eng
[signout-url              ] http://www.lds.org/signinout/?lang=eng&signmeout
[stake-leadership         ] https://www.lds.org/mobiledirectory/services/ludrs/unit/stake-leadership-positions
[stake-units              ] https://www.lds.org/mobiledirectory/services/ludrs/unit/current-user-stake-wards
[temple-recommend-status  ] https://www.lds.org/mls/mbr/services/recommend/endowed-members?unitNumber={unit}&lang=eng
[terms-url                ] http://www.lds.org/legal/terms?lang=eng
[unit-leadership          ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/unit/unit-leadershiplist/{unit}
[unit-leadership-new      ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/unit/unit-leadershiplist/{unit}
[unit-members-and-callings] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/member-detaillist-with-callings/{unit}
[unit-members-and-callings-v2] https://www.lds.org/mobiledirectory/services/v2/ldstools/member-detaillist-with-callings/{unit}
[unit-membership          ] https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/member-detaillist/{unit}
[unit-statistics          ] https://www.lds.org/mls/mbr/services/report/unit-statistics?unitNumber={unit}&lang=eng

So what I missed? Any configs? Is it my local environment issue?

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.1
$ python --version
Python 2.7.10

$ which python
/usr/bin/python

$ whereis python
/usr/bin/python

$ python3 --version
Python 3.6.3

$ which python3
/usr/local/bin/python3

$ whereis python3
# empty
$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
>>> import sys
>>> print(sys.path)
['', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']
>>> 
[1]  + 88950 suspended  python
python3
Python 3.6.3 (v3.6.3:2c5fed86e0, Oct  3 2017, 00:32:08) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> import sys
>>> print(sys.path)
['', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']

download failing

I have been using the module for a couple of years. I pull down latest data every week when preparing the sacrament printed program to validate spellings of names etc. A little over a week ago, things just stopped working. I haven't changed anything in my script. The signin still works but I get a 504 error when downloading the current-user-units json from this url: https://www.lds.org/mobiledirectory/services/ludrs/1.1/unit/mobile/current-user-units
I can see the same error in chrome. The page says:
Gateway Timeout
The proxy server did not receive a timely response from the upstream server.
Reference #1.64321cb8.1559162222.2ec9369

I wondering if anyone can verify if this happens to them as well. I tried it on a second computer with the same results.

If I run lds_org.py (running python3.5.3 under Windows 10) with this command line:
-e current-user-units --log -
I see this output:
Connected to pydev debugger (build 191.6605.12)
16314feb9b0 Get endpoints
16314feb9b0 Got 70 endponts
16314feb9b0 SIGNIN BruceGifford https://signin.lds.org/login.html
16314feb9b0 SIGNIN success!
16314feb9b0 GET current-user-units
16314feb9b0 GET https://www.lds.org/mobiledirectory/services/ludrs/1.1/unit/mobile/current-user-units
16314feb9b0 Request Headers {'Accept': '/',
'Accept-Encoding': 'gzip, deflate',
'Connection': 'keep-alive',
'Cookie': 'ObSSOCookie=1R3tfV6XMFTfxkjxtloXYniHszT3yPiY9SBl59ZWRl3S2Nll447STGUdynfypeBzOzd0W9hCguMQPg%2BNmBFWfhVqGkcIO0uaVBF4S80qUM5HOgYikjtIM69kbg3yPihh8%2FVR2BcrMccgPPVR7hLIoKhWuVFJPXBWwWMVc%2Blsr%2FrbF3adcl61UXE%2Fw7sQDSnKvvvlQvLTEWowTVFYORXQWxPNv1XbDTBR6RCfcLnF0V0zkHQ2x8elfuQr0mQ%2BSja0iLgSMm7KAndd7z7V8KBFTo8BIy8E8%2FIhUMC8pzijhLOBMRf9g86PBkTuaQKoJ3Tf; '
'TS01b89640=01999b7023b9ce523d52dfbdcce5707837d40f388ef97a9c2cb1c16f0c10010fa36f6e3da982181d4cf451285436ac498c57b45af2',
'User-Agent': 'python-requests/2.13.0'}
16314feb9b0 response=<Response [504]> length=0
16314feb9b0 Response Headers {'Connection': 'keep-alive',
'Content-Length': '251',
'Content-Type': 'text/html',
'Date': 'Sat, 01 Jun 2019 17:27:22 GMT',
'Expires': 'Sat, 01 Jun 2019 17:27:22 GMT',
'Mime-Version': '1.0',
'Server': 'AkamaiGHost',
'Server-Timing': 'cdn-cache; desc=HIT, edge; dur=240000'}
Error: 504 <Response [504]>

<TITLE>Gateway Timeout - In read </TITLE>

Gateway Timeout

The proxy server did not receive a timely response from the upstream server.

Reference #1.bed4c217.1559410042.377831c7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.