Skip to content
This repository was archived by the owner on Mar 26, 2021. It is now read-only.

switch to https urls in the DS_NPR_API class - #44

Merged
benlk merged 8 commits into
npr:masterfrom
INN:11-https-regex
Apr 16, 2018
Merged

benlk merged 8 commits into
npr:masterfrom
INN:11-https-regex

Conversation

@benlk

@benlk benlk commented Jan 22, 2018 •

Copy link
Copy Markdown
Contributor

Changes

(edited)

  • Replaces all http: URLs in the plugin with https: URLs
  • Updates the regular expressions used by DS_NPR_API::load_page_hook to find the story ID
  • Updates the NPRML XML namespace declaration to also use an HTTPS URL: NPRML XML namespace link does not return a schema #45
  • Replaces a few outdated NPR links in docs and readmes with correct ones, where the redirect worked in an obvious fashion:
    • Account signup pages
    • Ari Shapiro's bio

Why

From the update document:

With NPR.org going HTTPS, following update needs to be made in the Story API plugin for querying Story content so NPR stories can be queried by HTTPS and HTTP URLs

For INN#11

@benlk

benlk commented Jan 22, 2018

Copy link
Copy Markdown
Contributor Author

A question before merging: do any of these other references to insecure URLs need to be changed?

./classes/NPRAPI.php:  const NPRAPI_PULL_URL = 'http://api.npr.org';
./classes/NPRAPI.php:  const NPRML_NAMESPACE = 'xmlns:nprml=http://api.npr.org/nprml';
./classes/NPRAPIWordpress.php:   *   The path part of the request URL (i.e., http://example.com/PATH).
./ds-npr-api.php:	$def_url = 'http://api.npr.org';
./get_stories.php:					if ( stristr( $query_string, 'http:' ) ) {
./settings_ui.php:       <div><p>Create an NPR API query (see the <a target="_" href="http://www.npr.org/api/queryGenerator.php">NPR API query generator</a>). Enter your queries into one of the rows below to have stories on that query automatically publish to your site. Please note, you do not need to include your API key to the query.  </div>
./tests/test-ds-npr-api.php:		$this->assertEquals( $option, 'http://api.npr.org' );

@benlk

benlk commented Mar 19, 2018 •

Copy link
Copy Markdown
Contributor Author

@milespj

milespj commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

Hi Ben -

All of NPR's website links (including API calls) are generally now HTTPS. In fact if you find any that aren't HTTPS let me know! So, we should update all of the URL's to be HTTPS to eliminate unnecessary redirects.

@benlk

benlk commented Mar 20, 2018 •

Copy link
Copy Markdown
Contributor Author

Cool, I'll update this pull request with https urls for all the NPR links, where those links can be updated.

Of note:

benlk added 2 commits March 19, 2018 23:38
Also, replace some broken links where the correct link is obvious. Don't replace broken links where the broken link isn't obvious. See npr#44 (comment)
@milespj

milespj commented Mar 21, 2018

Copy link
Copy Markdown
Contributor

Thanks for all of these documentation edits! Other than the one URL that was still marked as HTTP this looks good.

@benlk

benlk commented Mar 23, 2018

Copy link
Copy Markdown
Contributor Author

That must've happened when I merged f4032ce into this branch; my bad. It's fixed now.

@milespj

milespj commented Apr 13, 2018

Copy link
Copy Markdown
Contributor

Just wanted to mention that I'm good with this pull request!

@benlk
benlk merged commit 9d3b111 into npr:master Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants