samuelclay / NewsBlur

NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
http://www.newsblur.com
MIT License
6.91k stars 999 forks source link

iOS: Include a subscribe to site page on the share sheet #1575

Closed samuelclay closed 2 years ago

samuelclay commented 2 years ago

I want to subscribe to a site from safari. Let's add that feature to the share sheet.

image

Dejal commented 2 years ago

This is implemented, but needs server-side support. Please add support for the secret token to the reader/add_url endpoint, like api/share_story and api/save_story. It should then Just Work™.

Add This Site

samuelclay commented 2 years ago

Is there any way to let the user know if this worked or not? I would like to at the very least have the newsblur app send a notification to the user from the background saying if it worked or not. But better to just have a loading spinner and then "added" or "failed due to $error" message. Let the user close the dialog. Or we could have a 1 second delay. But on the bookmarklet, we don't close it after subscribing.

samuelclay commented 2 years ago

Also, can we use the newsblur icons?

Dejal commented 2 years ago

I've updated it to use the NewsBlur icons (which required a number of changes), and to display a notification of success or failure. The share sheet is designed to dismiss when the user taps the button, and perform the request in the background, so leaving it open would go against that, and make it feel sluggish.

Interestingly, adding a site reports success, but the server response is a 403. I'd guess it isn't recognizing the secret token parameter. Did you not add that (see above comments)?

POST URL: https://www.newsblur.com/reader/add_url/2785fe5513db
Status Code: 403
samuelclay commented 2 years ago

You'll want the url from #1584: /api/add_url/<token>

samuelclay commented 2 years ago

It's funny, the only undocumented API endpoints are the ones found in the API app under /api/.

Dejal commented 2 years ago

Okay, I changed it to use that URL, and now it gets a 200 status code, but the new site doesn't show up (in the app or web).

The request URL is https://www.newsblur.com/api/add_url/2785fe5513db

The request POST body is folder=Bar&url=https://www.apple.com/

What's the issue?

samuelclay commented 2 years ago

Is that the actual url? apple.com doesn't have an RSS feed attached to it, so it wouldn't be added.

Oh, and looking at the code, it's a GET request because it's on the /api/, so it needs to be fetched from a bookmarklet that can't issue a POST request. So a GET it is.

samuelclay commented 2 years ago

Also you'll notice that the response is wrapped in an optional callback (used for JSONP). If you'd prefer, I can take out the () wrapper around the response if a callback is not requested. But if the iOS json parser has no problem, I'd prefer to leave it as is.

Dejal commented 2 years ago

Any chance you could make it work with POST too? I could change the code to do a GET, but it might be more trivial server-side?

The extension ignores the response body, so you can send anything or nothing as desired.

samuelclay commented 2 years ago

Of course, there's a couple other places where I've had to accept both. FYI, Django removed request.REQUEST like five years ago, so it's now an anti-pattern, which from an api normalization standpoint, it makes sense. But it was convenient supporting all sorts of use cases.

Anyway, change has been deployed.

Dejal commented 2 years ago

Hmm. It's live? Still not working. Are you able to see the request and determine why?

(I changed it to add https://dejus.com/ instead, which does have a RSS feed.)

samuelclay commented 2 years ago

Send the request to staging.newsblur.com and I can tell you what's going on

Dejal commented 2 years ago

Just did one there.

samuelclay commented 2 years ago

I see both requests in the logs. What do you see back in the response? My logging isn't triggering and no exceptions are being raised, so I have no idea where the request is going.

samuelclay commented 2 years ago
[Mar 11 21:15:47]  ---> GET /reader/feeds {'flat': ['true'], 'update_counts': ['false'], 'include_inactive': ['true']}
[Mar 11 21:15:47]  ---> [iPhone] [0.48s] [Dejal*] Loading 54/4/8 feeds/socials/inactive flat
[Mar 11 21:15:48]  ---> [iPhone] [0.50s] [Dejal*] DB times /reader/feeds: sql: 0.0910s mongo: 0.01394s redis: user:0.000250s story:0.000000s session:0.000053s pubsub:0.000000s
[Mar 11 21:15:48]  ---> [iPhone] [0.50s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:14:55.293024 (89.45.90.70)
[Mar 11 21:15:48]  ---> GET /reader/refresh_feeds
[Mar 11 21:15:49]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:15:49]  ---> [iPhone] [0.83s] [Dejal*] Refreshing 54+6 feeds  (0.01/0.80/0.81)
[Mar 11 21:15:49]  ---> [iPhone] [0.86s] [Dejal*] DB times /reader/refresh_feeds: sql: 0.0120s mongo: 0.00774s redis: user:0.000305s story:0.000611s session:0.000035s pubsub:0.000000s
[Mar 11 21:15:49]  ---> [iPhone] [0.87s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:15:48.002802 (89.45.90.70)
[Mar 11 21:15:49]  ---> GET /reader/favicons
[Mar 11 21:15:49]  ---> [iPhone] [0.04s] [Dejal*] DB times /reader/favicons: sql: 0.0040s mongo: 0.00609s redis: user:0.000156s story:0.000000s session:0.000057s pubsub:0.000000s
[Mar 11 21:15:49]  ---> GET /reader/river_stories_widget/ {'include_hidden': ['false'], 'replace_hidden_stories': ['true'], 'thumbnail_size': ['192'], 'page':...[139 bytes]...68', '3240', '8429586', '3581', '38', '183139', '1186180', '569'], 'secret_token': ['2785fe5513db']}
[Mar 11 21:15:49]  ---> [------] [0.00s] [AnonymousUser] Widget load
[Mar 11 21:15:49]  ---> [------] [0.13s] [Dejal*] Loading river stories: p1 (6/6 stories, 5/6/11 feeds, newest/unread)
[Mar 11 21:15:49]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,srZ5Tp7b-AxHHIX0bISsvobanzTHoCpOrMyITUodUHYg=/https://pbs.twimg.com/profile_images/840227817493278720/vv_nJ3IW_normal.jpg" fetched in 0.02945542335510254s
[Mar 11 21:15:49]  ---> GET /reader/unread_story_hashes {'include_timestamps': ['true']}
[Mar 11 21:15:49]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sa9UIWZkn2-jODRkMwP2K27bf5MnvAlpEH4VSeiJxTkY=/https://i0.wp.com/sinclairtrails.com/wp-content/uploads/2022/03/IMG_8431.jpeg?resize=1024%2C1365&ssl=1" fetched in 0.25066113471984863s
[Mar 11 21:15:49]  ---> [------] [0.39s] [Dejal*] Elapsed Time: 0.2517685890197754s
[Mar 11 21:15:49]  ---> [------] [0.40s] [Dejal*] DB times /reader/river_stories_widget/: sql: 0.0810s mongo: 0.00676s redis: user:0.000984s story:0.000496s session:0.000000s pubsub:0.000000s
[Mar 11 21:15:50]  ---> [------] [0.30s] [Dejal*] Loading unread story hashes: 0 feeds (30 story hashes)
[Mar 11 21:15:50]  ---> [------] [0.32s] [Dejal*] DB times /reader/unread_story_hashes: sql: 0.0050s mongo: 0.00000s redis: user:0.000154s story:0.001830s session:0.000319s pubsub:0.000000s
[Mar 11 21:15:50]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6476:9d084a', '6476:18739a', '8264791:15cda9', '6...[1422 bytes]...6', '1665281:46974f', '6476:3fa095', '6556107:95638c', '2186:4d5b87', '6476:9bd5a4', '6476:f03970']}
[Mar 11 21:15:51]  ---> [------] [0.15s] [Dejal*] Loading 100 stories: ['6476:9d084a', '6476:18739a', '8264791:15cda9']...(+97)
[Mar 11 21:15:51]  ---> [------] [0.18s] [Dejal*] DB times /reader/river_stories: sql: 0.0040s mongo: 0.02111s redis: user:0.000158s story:0.000000s session:0.000388s pubsub:0.000000s
[Mar 11 21:15:53]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6556107:159e1f', '6476:eab106', '6476:4d4659', '8...[1453 bytes]...b', '8264791:da2cfb', '6476:4d2f57', '6476:fdad11', '6476:1dd1ff', '6476:297353', '6556107:d7f6bd']}
[Mar 11 21:15:54]  ---> [------] [0.13s] [Dejal*] Loading 100 stories: ['6556107:159e1f', '6476:eab106', '6476:4d4659']...(+97)
[Mar 11 21:15:54]  ---> [------] [0.14s] [Dejal*] DB times /reader/river_stories: sql: 0.0050s mongo: 0.01446s redis: user:0.000278s story:0.000000s session:0.000018s pubsub:0.000000s
[Mar 11 21:15:59]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6476:461a75', '6476:f4ccbb', '5994357:958b02', '8...[1461 bytes]...62cc', '8264792:20230c', '2308:de06b7', '6476:84c1e6', '6476:0f8f80', '2186:403767', '2998:e63202']}
[Mar 11 21:15:59]  ---> [------] [0.17s] [Dejal*] Loading 100 stories: ['6476:461a75', '6476:f4ccbb', '5994357:958b02']...(+97)
[Mar 11 21:15:59]  ---> [------] [0.19s] [Dejal*] DB times /reader/river_stories: sql: 0.0280s mongo: 0.01387s redis: user:0.000231s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:16:02]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6037101:79b50d', '2308:10e068', '146:6c8d63', '29...[1444 bytes]...7', '6476:6a7651', '6476:916972', '6476:4df5bc', '8264791:26b661', '8264792:a5190a', '2998:5e57a4']}
[Mar 11 21:16:02]  ---> [------] [0.07s] [Dejal*] Loading 100 stories: ['6037101:79b50d', '2308:10e068', '146:6c8d63']...(+97)
[Mar 11 21:16:02]  ---> [------] [0.09s] [Dejal*] DB times /reader/river_stories: sql: 0.0070s mongo: 0.01432s redis: user:0.000314s story:0.000000s session:0.000020s pubsub:0.000000s
[Mar 11 21:16:04]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['1186180:711229', '6476:44c34f', '6476:872b39', '6...[1453 bytes]...:c51e3e', '6476:1180b4', '6476:5b1d16', '6476:78a798', '6476:b6c703', '6476:08bcb9', '6476:5ad243']}
[Mar 11 21:16:04]  ---> [------] [0.10s] [Dejal*] Loading 100 stories: ['1186180:711229', '6476:44c34f', '6476:872b39']...(+97)
[Mar 11 21:16:04]  ---> [------] [0.12s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.03038s redis: user:0.000191s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:16:10]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['8264791:053ee2', '6556107:e77fd1', '6476:49187b',...[1449 bytes]...68cb', '6476:b65576', '6476:ff41ef', '6476:9e5c61', '6476:6a81e6', '6476:43dadd', '8264792:7becef']}
[Mar 11 21:16:10]  ---> [------] [0.07s] [Dejal*] Loading 100 stories: ['8264791:053ee2', '6556107:e77fd1', '6476:49187b']...(+97)
[Mar 11 21:16:10]  ---> [------] [0.09s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.01597s redis: user:0.000337s story:0.000000s session:0.000018s pubsub:0.000000s
[Mar 11 21:16:13]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['2998:a91951', '6476:f12046', '6556107:dfed5d', '8...[1442 bytes]...:f846e6', '2998:191e1d', '6476:32b615', '6476:25b25b', '6476:7a7ac5', '2998:569719', '6476:42eed1']}
[Mar 11 21:16:13]  ---> [------] [0.22s] [Dejal*] Loading 100 stories: ['2998:a91951', '6476:f12046', '6556107:dfed5d']...(+97)
[Mar 11 21:16:13]  ---> [------] [0.23s] [Dejal*] DB times /reader/river_stories: sql: 0.0410s mongo: 0.02068s redis: user:0.000309s story:0.000000s session:0.000018s pubsub:0.000000s
[Mar 11 21:16:15]  ---> POST /api/add_url/2785fe5513db {'folder': ['everything'], 'url': ['https://dejus.com/']}
[Mar 11 21:16:17]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6476:e2a729', '6556107:eca11e', '6476:31a6eb', '2...[1460 bytes]...792:533666', '8264792:72c7cc', '6342410:826e06', '2186:3e86ab', '8264792:0fd01c', '8264791:849adb']}
[Mar 11 21:16:18]  ---> [------] [0.17s] [Dejal*] Loading 100 stories: ['6476:e2a729', '6556107:eca11e', '6476:31a6eb']...(+97)
[Mar 11 21:16:18]  ---> [------] [0.19s] [Dejal*] DB times /reader/river_stories: sql: 0.0050s mongo: 0.02586s redis: user:0.000258s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:16:22]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['5719953:a16310', '8264791:e76b25', '2308:894dbc',...[1497 bytes]...264796:7636d5', '6556107:7ca8f6', '2998:37a547', '8264791:3e60cb', '2998:351fab', '8264791:d9f403']}
[Mar 11 21:16:22]  ---> [------] [0.07s] [Dejal*] Loading 100 stories: ['5719953:a16310', '8264791:e76b25', '2308:894dbc']...(+97)
[Mar 11 21:16:22]  ---> [------] [0.09s] [Dejal*] DB times /reader/river_stories: sql: 0.0070s mongo: 0.01803s redis: user:0.000298s story:0.000000s session:0.000019s pubsub:0.000000s
[Mar 11 21:16:22]  ---> GET /reader/feeds {'flat': ['true'], 'update_counts': ['true'], 'include_inactive': ['true']}
[Mar 11 21:16:22]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:16:22]  ---> [Dejal <dev@dejal.com> (Premium: True)] Computing social scores: 32048 (0/0/0)
[Mar 11 21:16:22]  ---> [iPhone] [0.35s] [Dejal*] Loading 54/4/8 feeds/socials/inactive flat. Updating counts.
[Mar 11 21:16:22]  ---> [iPhone] [0.36s] [Dejal*] DB times /reader/feeds: sql: 0.0740s mongo: 0.01527s redis: user:0.000300s story:0.000344s session:0.000018s pubsub:0.000000s
[Mar 11 21:16:22]  ---> [iPhone] [0.36s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:15:49.266983 (89.45.90.70)
[Mar 11 21:16:23]  ---> GET /reader/refresh_feeds
[Mar 11 21:16:23]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:16:23]  ---> [iPhone] [0.12s] [Dejal*] Refreshing 54+6 feeds  (0.01/0.10/0.11)
[Mar 11 21:16:23]  ---> [iPhone] [0.13s] [Dejal*] DB times /reader/refresh_feeds: sql: 0.0140s mongo: 0.00517s redis: user:0.000284s story:0.000422s session:0.000017s pubsub:0.000000s
[Mar 11 21:16:23]  ---> [iPhone] [0.13s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:16:22.701820 (89.45.90.70)
[Mar 11 21:16:23]  ---> GET /reader/favicons
[Mar 11 21:16:23]  ---> [iPhone] [0.02s] [Dejal*] DB times /reader/favicons: sql: 0.0030s mongo: 0.00928s redis: user:0.000263s story:0.000000s session:0.000016s pubsub:0.000000s
[Mar 11 21:16:23]  ---> GET /reader/unread_story_hashes {'include_timestamps': ['true']}
[Mar 11 21:16:23]  ---> [------] [0.07s] [Dejal*] Loading unread story hashes: 0 feeds (30 story hashes)
[Mar 11 21:16:23]  ---> [------] [0.08s] [Dejal*] DB times /reader/unread_story_hashes: sql: 0.0040s mongo: 0.00000s redis: user:0.000169s story:0.001843s session:0.000028s pubsub:0.000000s
[Mar 11 21:16:24]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['5719953:e59c4b', '6556107:d611a6', '6556107:6ed53...[1483 bytes]... '2998:7c9833', '2998:451320', '6037101:41f1b7', '2998:29d8dc', '6556107:06df0f', '6342410:5f1433']}
[Mar 11 21:16:24]  ---> [------] [0.09s] [Dejal*] Loading 100 stories: ['5719953:e59c4b', '6556107:d611a6', '6556107:6ed53a']...(+97)
[Mar 11 21:16:24]  ---> [------] [0.11s] [Dejal*] DB times /reader/river_stories: sql: 0.0080s mongo: 0.01920s redis: user:0.000407s story:0.000000s session:0.000019s pubsub:0.000000s
[Mar 11 21:16:27]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['2308:1b9b0b']}
[Mar 11 21:16:27]  ---> [------] [0.01s] [Dejal*] Loading 1 stories: ['2308:1b9b0b']
[Mar 11 21:16:27]  ---> [------] [0.02s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.00214s redis: user:0.000172s story:0.000000s session:0.000024s pubsub:0.000000s
[Mar 11 21:17:01]  ---> GET /reader/feeds {'flat': ['true'], 'update_counts': ['true'], 'include_inactive': ['true']}
[Mar 11 21:17:01]  ---> [------] [Dejal*] Unread count (5994357): (0/4/0) to (0/4/0)
[Mar 11 21:17:02]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:17:02]  ---> [Dejal <dev@dejal.com> (Premium: True)] Computing social scores: 32048 (0/0/0)
[Mar 11 21:17:02]  ---> [iPhone] [0.43s] [Dejal*] Loading 54/4/8 feeds/socials/inactive flat. Updating counts.
[Mar 11 21:17:02]  ---> [iPhone] [0.45s] [Dejal*] DB times /reader/feeds: sql: 0.0970s mongo: 0.01786s redis: user:0.000344s story:0.000573s session:0.000020s pubsub:0.000000s
[Mar 11 21:17:02]  ---> [iPhone] [0.45s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:16:23.279449 (89.45.90.70)
[Mar 11 21:17:02]  ---> GET /reader/refresh_feeds
[Mar 11 21:17:02]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:17:02]  ---> [iPhone] [0.13s] [Dejal*] Refreshing 54+6 feeds  (0.01/0.09/0.10)
[Mar 11 21:17:03]  ---> [iPhone] [0.17s] [Dejal*] DB times /reader/refresh_feeds: sql: 0.0130s mongo: 0.00577s redis: user:0.000314s story:0.000413s session:0.000023s pubsub:0.000000s
[Mar 11 21:17:03]  ---> [iPhone] [0.17s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:17:02.185003 (89.45.90.70)
[Mar 11 21:17:03]  ---> GET /reader/favicons
[Mar 11 21:17:03]  ---> [iPhone] [0.03s] [Dejal*] DB times /reader/favicons: sql: 0.0020s mongo: 0.00636s redis: user:0.000178s story:0.000000s session:0.000024s pubsub:0.000000s
[Mar 11 21:17:03]  ---> GET /reader/unread_story_hashes {'include_timestamps': ['true']}
[Mar 11 21:17:03]  ---> [------] [0.20s] [Dejal*] Loading unread story hashes: 0 feeds (30 story hashes)
[Mar 11 21:17:03]  ---> [------] [0.21s] [Dejal*] DB times /reader/unread_story_hashes: sql: 0.0030s mongo: 0.00000s redis: user:0.000168s story:0.001243s session:0.000019s pubsub:0.000000s
[Mar 11 21:17:04]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['2308:1b9b0b']}
[Mar 11 21:17:04]  ---> [------] [0.02s] [Dejal*] Loading 1 stories: ['2308:1b9b0b']
[Mar 11 21:17:04]  ---> [------] [0.02s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.00255s redis: user:0.000189s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:18:02]  ---> GET /reader/feed/146/ {'include_hidden': ['true'], 'page': ['1'], 'order': ['newest'], 'read_filter': ['all']}
[Mar 11 21:18:02]  ---> [iPhone] [0.04s] [Dejal*] Loading feed: FlowingData (newest/all) (0.01/0.01/0.01/0.02)
[Mar 11 21:18:02]  ---> [iPhone] [0.05s] [Dejal*] DB times /reader/feed/146/: sql: 0.0100s mongo: 0.00708s redis: user:0.000321s story:0.000060s session:0.000026s pubsub:0.000000s
[Mar 11 21:18:02]  ---> GET /reader/feed/146/ {'include_hidden': ['true'], 'page': ['2'], 'order': ['newest'], 'read_filter': ['all']}
[Mar 11 21:18:02]  ---> [iPhone] [0.04s] [Dejal*] Loading feed: FlowingData/p2 (newest/all) (0.01/0.01/0.01/0.02)
[Mar 11 21:18:02]  ---> [iPhone] [0.05s] [Dejal*] DB times /reader/feed/146/: sql: 0.0080s mongo: 0.00779s redis: user:0.000293s story:0.000098s session:0.000033s pubsub:0.000000s
[Mar 11 21:19:30]  ---> POST /api/add_url/2785fe5513db {'folder': ['Bar'], 'url': ['https://sinclairtrails.com/']}
[Mar 11 21:19:37]  ---> GET /reader/feeds {'flat': ['true'], 'update_counts': ['true'], 'include_inactive': ['true']}
[Mar 11 21:19:37]  ---> [------] [Dejal*] Unread count (146/trained): (0/0/25) to (0/0/25)
[Mar 11 21:19:37]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:19:37]  ---> [Dejal <dev@dejal.com> (Premium: True)] Computing social scores: 32048 (0/0/0)
[Mar 11 21:19:37]  ---> [iPhone] [0.34s] [Dejal*] Loading 54/4/8 feeds/socials/inactive flat. Updating counts.
[Mar 11 21:19:37]  ---> [iPhone] [0.36s] [Dejal*] DB times /reader/feeds: sql: 0.0670s mongo: 0.02248s redis: user:0.000272s story:0.000386s session:0.000019s pubsub:0.000000s
[Mar 11 21:19:37]  ---> [iPhone] [0.36s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:17:03.043758 (89.45.90.70)
[Mar 11 21:19:37]  ---> GET /reader/refresh_feeds
[Mar 11 21:19:38]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:19:38]  ---> [iPhone] [0.62s] [Dejal*] Refreshing 54+6 feeds  (0.00/0.60/0.60)
[Mar 11 21:19:38]  ---> [iPhone] [0.63s] [Dejal*] DB times /reader/refresh_feeds: sql: 0.0140s mongo: 0.00559s redis: user:0.000272s story:0.000351s session:0.000018s pubsub:0.000000s
[Mar 11 21:19:38]  ---> [iPhone] [0.63s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:19:37.545409 (89.45.90.70)
[Mar 11 21:19:38]  ---> GET /reader/favicons
[Mar 11 21:19:38]  ---> [iPhone] [0.02s] [Dejal*] DB times /reader/favicons: sql: 0.0020s mongo: 0.00426s redis: user:0.000182s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:19:39]  ---> GET /reader/unread_story_hashes {'include_timestamps': ['true']}
[Mar 11 21:19:39]  ---> [------] [0.05s] [Dejal*] Loading unread story hashes: 0 feeds (30 story hashes)
[Mar 11 21:19:39]  ---> [------] [0.06s] [Dejal*] DB times /reader/unread_story_hashes: sql: 0.0030s mongo: 0.00000s redis: user:0.000169s story:0.001412s session:0.000016s pubsub:0.000000s
[Mar 11 21:19:40]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['3581:0ab009', '3581:ff84d0', '6556107:06df0f']}
[Mar 11 21:19:40]  ---> [------] [0.01s] [Dejal*] Loading 3 stories: ['3581:0ab009', '3581:ff84d0', '6556107:06df0f']
[Mar 11 21:19:40]  ---> [------] [0.02s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.00324s redis: user:0.000205s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:19:41]  ---> GET /reader/feeds {'flat': ['true'], 'update_counts': ['true'], 'include_inactive': ['true']}
[Mar 11 21:19:43]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:19:43]  ---> [Dejal <dev@dejal.com> (Premium: True)] Computing social scores: 32048 (0/0/0)
[Mar 11 21:19:43]  ---> [iPhone] [2.09s] [Dejal*] Loading 54/4/8 feeds/socials/inactive flat. Updating counts.
[Mar 11 21:19:43]  ---> [iPhone] [2.10s] [Dejal*] DB times /reader/feeds: sql: 0.0560s mongo: 0.01463s redis: user:0.000250s story:0.000368s session:0.000017s pubsub:0.000000s
[Mar 11 21:19:43]  ---> [iPhone] [2.10s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:19:38.387865 (89.45.90.70)
[Mar 11 21:19:43]  ---> GET /reader/refresh_feeds
[Mar 11 21:19:43]  ---> [------] [Dejal*] Read story in social subscription: popular
[Mar 11 21:19:43]  ---> [iPhone] [0.09s] [Dejal*] Refreshing 54+6 feeds  (0.00/0.08/0.08)
[Mar 11 21:19:43]  ---> [iPhone] [0.10s] [Dejal*] DB times /reader/refresh_feeds: sql: 0.0120s mongo: 0.00548s redis: user:0.000240s story:0.000332s session:0.000017s pubsub:0.000000s
[Mar 11 21:19:43]  ---> [iPhone] [0.10s] [Dejal*] Repeat visitor (ignored): 2022-03-11 21:19:43.328217 (89.45.90.70)
[Mar 11 21:19:44]  ---> GET /reader/favicons
[Mar 11 21:19:44]  ---> [iPhone] [0.02s] [Dejal*] DB times /reader/favicons: sql: 0.0020s mongo: 0.00337s redis: user:0.000176s story:0.000000s session:0.000020s pubsub:0.000000s
[Mar 11 21:19:44]  ---> GET /reader/unread_story_hashes {'include_timestamps': ['true']}
[Mar 11 21:19:44]  ---> [------] [0.03s] [Dejal*] Loading unread story hashes: 0 feeds (30 story hashes)
[Mar 11 21:19:44]  ---> [------] [0.04s] [Dejal*] DB times /reader/unread_story_hashes: sql: 0.0030s mongo: 0.00000s redis: user:0.000158s story:0.001227s session:0.000023s pubsub:0.000000s
[Mar 11 21:19:45]  ---> GET /reader/river_stories {'include_hidden': ['true'], 'page': ['0'], 'h': ['6556107:06df0f']}
[Mar 11 21:19:45]  ---> [------] [0.01s] [Dejal*] Loading 1 stories: ['6556107:06df0f']
[Mar 11 21:19:45]  ---> [------] [0.02s] [Dejal*] DB times /reader/river_stories: sql: 0.0030s mongo: 0.00273s redis: user:0.000175s story:0.000000s session:0.000017s pubsub:0.000000s
[Mar 11 21:19:51]  ---> GET /reader/river_stories_widget/ {'include_hidden': ['false'], 'replace_hidden_stories': ['true'], 'thumbnail_size': ['192'], 'page':...[139 bytes]...68', '3240', '8429586', '3581', '38', '183139', '1186180', '569'], 'secret_token': ['2785fe5513db']}
[Mar 11 21:19:51]  ---> [------] [0.00s] [AnonymousUser] Widget load
[Mar 11 21:19:51]  ---> [------] [0.09s] [Dejal*] Loading river stories: p1 (6/6 stories, 4/6/11 feeds, newest/unread)
[Mar 11 21:19:52]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sa9UIWZkn2-jODRkMwP2K27bf5MnvAlpEH4VSeiJxTkY=/https://i0.wp.com/sinclairtrails.com/wp-content/uploads/2022/03/IMG_8431.jpeg?resize=1024%2C1365&ssl=1" fetched in 0.4090845584869385s
[Mar 11 21:19:52]  ---> [------] [0.52s] [Dejal*] Elapsed Time: 0.41025400161743164s
[Mar 11 21:19:52]  ---> [------] [0.52s] [Dejal*] DB times /reader/river_stories_widget/: sql: 0.0570s mongo: 0.00570s redis: user:0.000556s story:0.000281s session:0.000000s pubsub:0.000000s
[Mar 11 21:21:46]  ---> GET ///remote/fgt_lang {'lang': ['/../../../..//////////dev/']}
[Mar 11 21:22:22]  ---> GET /reader/river_stories_widget/ {'include_hidden': ['false'], 'replace_hidden_stories': ['true'], 'thumbnail_size': ['192'], 'page':...[139 bytes]...68', '3240', '8429586', '3581', '38', '183139', '1186180', '569'], 'secret_token': ['2785fe5513db']}
[Mar 11 21:22:22]  ---> [------] [0.00s] [AnonymousUser] Widget load
[Mar 11 21:22:22]  ---> [------] [0.08s] [Dejal*] Loading river stories: p1 (6/6 stories, 4/6/11 feeds, newest/unread)
[Mar 11 21:22:23]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sEBF4RTFK4F05X5AqLOxpmMHgFSo4JQE7cQjnfZUdGDI=/https://149346090.v2.pressablecdn.com/wp-content/uploads/2022/03/IMG_0337-600x1066.png" fetched in 0.2936997413635254s
[Mar 11 21:22:23]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sU4XT0msT5u1BIykBgAmz8CvPdGq8OPPjZOtk3Y-Hllc=/https://miro.medium.com/max/1400/1*916Or4DcgAHz_pJ2uHteng.png" fetched in 0.34435582160949707s
[Mar 11 21:22:23]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sa9UIWZkn2-jODRkMwP2K27bf5MnvAlpEH4VSeiJxTkY=/https://i0.wp.com/sinclairtrails.com/wp-content/uploads/2022/03/IMG_8431.jpeg?resize=1024%2C1365&ssl=1" fetched in 0.3601374626159668s
[Mar 11 21:22:23]  ---> [------] [0.44s] [Dejal*] Elapsed Time: 0.3614802360534668s
[Mar 11 21:22:23]  ---> [------] [0.45s] [Dejal*] DB times /reader/river_stories_widget/: sql: 0.0480s mongo: 0.00520s redis: user:0.000544s story:0.000252s session:0.000000s pubsub:0.000000s
[Mar 11 21:22:26]  ---> GET /reader/feed/146/ {'include_hidden': ['true'], 'page': ['1'], 'order': ['newest'], 'read_filter': ['all']}
[Mar 11 21:22:26]  ---> [iPhone] [0.03s] [Dejal*] Loading feed: FlowingData (newest/all) (0.00/0.01/0.01/0.02)
[Mar 11 21:22:26]  ---> [iPhone] [0.04s] [Dejal*] DB times /reader/feed/146/: sql: 0.0070s mongo: 0.00496s redis: user:0.000304s story:0.000066s session:0.000017s pubsub:0.000000s
[Mar 11 21:22:27]  ---> GET /reader/feed/146/ {'include_hidden': ['true'], 'page': ['2'], 'order': ['newest'], 'read_filter': ['all']}
[Mar 11 21:22:27]  ---> [iPhone] [0.03s] [Dejal*] Loading feed: FlowingData/p2 (newest/all) (0.01/0.01/0.01/0.02)
[Mar 11 21:22:27]  ---> [iPhone] [0.04s] [Dejal*] DB times /reader/feed/146/: sql: 0.0070s mongo: 0.00585s redis: user:0.000428s story:0.000062s session:0.000019s pubsub:0.000000s
[Mar 11 21:23:01]  ---> GET /social/profile {'user_id': ['375710'], 'category': ['follow', 'comment_reply', 'comment_like', 'sharedstory']}
[Mar 11 21:23:01]  ---> [iPhone] [0.05s] [Dejal*] Loading social profile: Dejal
[Mar 11 21:23:01]  ---> [iPhone] [0.25s] [Dejal*] DB times /social/profile: sql: 0.0250s mongo: 0.01539s redis: user:0.000371s story:0.000000s session:0.000019s pubsub:0.000000s
[Mar 11 21:26:31]  ---> GET /reader/river_stories_widget/ {'include_hidden': ['false'], 'replace_hidden_stories': ['true'], 'thumbnail_size': ['192'], 'page':...[139 bytes]...68', '3240', '8429586', '3581', '38', '183139', '1186180', '569'], 'secret_token': ['2785fe5513db']}
[Mar 11 21:26:31]  ---> [------] [0.00s] [AnonymousUser] Widget load
[Mar 11 21:26:32]  ---> [------] [0.74s] [Dejal*] Loading river stories: p1 (6/6 stories, 4/6/11 feeds, newest/unread)
[Mar 11 21:26:32]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sU4XT0msT5u1BIykBgAmz8CvPdGq8OPPjZOtk3Y-Hllc=/https://miro.medium.com/max/1400/1*916Or4DcgAHz_pJ2uHteng.png" fetched in 0.33959531784057617s
[Mar 11 21:26:32]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sEBF4RTFK4F05X5AqLOxpmMHgFSo4JQE7cQjnfZUdGDI=/https://149346090.v2.pressablecdn.com/wp-content/uploads/2022/03/IMG_0337-600x1066.png" fetched in 0.3747825622558594s
[Mar 11 21:26:32]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sa9UIWZkn2-jODRkMwP2K27bf5MnvAlpEH4VSeiJxTkY=/https://i0.wp.com/sinclairtrails.com/wp-content/uploads/2022/03/IMG_8431.jpeg?resize=1024%2C1365&ssl=1" fetched in 0.3931548595428467s
[Mar 11 21:26:32]  ---> [------] [1.14s] [Dejal*] Elapsed Time: 0.3938593864440918s
[Mar 11 21:26:32]  ---> [------] [1.15s] [Dejal*] DB times /reader/river_stories_widget/: sql: 0.0460s mongo: 0.00626s redis: user:0.000593s story:0.000274s session:0.000000s pubsub:0.000000s
[Mar 11 21:30:33]  ---> GET /reader/river_stories_widget/ {'include_hidden': ['false'], 'replace_hidden_stories': ['true'], 'thumbnail_size': ['192'], 'page':...[139 bytes]...68', '3240', '8429586', '3581', '38', '183139', '1186180', '569'], 'secret_token': ['2785fe5513db']}
[Mar 11 21:30:33]  ---> [------] [0.00s] [AnonymousUser] Widget load
[Mar 11 21:30:34]  ---> [------] [0.21s] [Dejal*] Loading river stories: p1 (6/6 stories, 4/6/11 feeds, newest/unread)
[Mar 11 21:30:34]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sEBF4RTFK4F05X5AqLOxpmMHgFSo4JQE7cQjnfZUdGDI=/https://149346090.v2.pressablecdn.com/wp-content/uploads/2022/03/IMG_0337-600x1066.png" fetched in 0.37745141983032227s
[Mar 11 21:30:34]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sa9UIWZkn2-jODRkMwP2K27bf5MnvAlpEH4VSeiJxTkY=/https://i0.wp.com/sinclairtrails.com/wp-content/uploads/2022/03/IMG_8431.jpeg?resize=1024%2C1365&ssl=1" fetched in 0.3863494396209717s
[Mar 11 21:30:34]  ---> [------] [Dejal*] "https://imageproxy.newsblur.com/192,sc,sU4XT0msT5u1BIykBgAmz8CvPdGq8OPPjZOtk3Y-Hllc=/https://miro.medium.com/max/1400/1*916Or4DcgAHz_pJ2uHteng.png" fetched in 0.42284679412841797s
[Mar 11 21:30:34]  ---> [------] [0.64s] [Dejal*] Elapsed Time: 0.4238739013671875s
[Mar 11 21:30:34]  ---> [------] [0.65s] [Dejal*] DB times /reader/river_stories_widget/: sql: 0.0570s mongo: 0.00641s redis: user:0.000748s story:0.000355s session:0.000000s pubsub:0.000000s
Dejal commented 2 years ago

When I reload the feeds in the main app, or on the website, the feed hasn't been added.

The extension doesn't look at the response, but it's just a 200 status:

⚾️ share: Optional(<NSHTTPURLResponse: 0x600000fda020> { URL: https://staging.newsblur.com/api/add_url/2785fe5513db } { Status Code: 200, Headers {
    "Content-Encoding" =     (
        gzip
    );
    "Content-Length" =     (
        14873
    );
    "Content-Type" =     (
        "text/html; charset=utf-8"
    );
    Date =     (
        "Fri, 11 Mar 2022 21:19:30 GMT"
    );
    Server =     (
        "gunicorn/20.0.4"
    );
    "Strict-Transport-Security" =     (
        "max-age=0; includeSubDomains"
    );
    Vary =     (
        "Authorization, Cookie, Accept-Encoding"
    );
    "x-gunicorn-server" =     (
        "staging-web"
    );
    "x-homer" =     (
        "Bart, with $10,000 we'd be millionaires! We could buy all kinds of useful things like...love!"
    );
} })
samuelclay commented 2 years ago

Any chance you can see what's in the response? There's probably a message in there about the feed fetch.

Dejal commented 2 years ago

Here's the response data; not very JSONy:

\n\n\n\n<!DOCTYPE html>\n<html>\n<head>\n  <title>The NewsBlur API</title>\n  <link rel=\"shortcut icon\" href=\"/media/img/favicon.ico\" type=\"image/png\" />\n  <link rel=\"icon\" href=\"/media/img/favicon_32.png\" sizes=\"32x32\"/>\n  <link rel=\"icon\" href=\"/media/img/favicon_64.png\" sizes=\"64x64\"/>\n  <link rel=\"apple-touch-icon\" href=\"/media/img/mobile/apple-touch-icon-precomposed.png\" />\n  <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n  <meta name=\"msapplication-TileImage\" content=\"/media/img/logo_144.png\" />\n  <meta name=\"msapplication-TileColor\" content=\"#F7E5A8\"/>\n  <meta name=\"apple-itunes-app\" content=\"app-id=463981119\">\n  <link rel=\"manifest\" href=\"/manifest.webmanifest\">\n  <!-- <link rel=\"mask-icon\" href=\"/media/img/favicon_monochrome.svg\" color=\"orange\"> -->\n  \n  <script type=\"text/javascript\" charset=\"utf-8\">\n    window.NEWSBLUR = {};\n    NEWSBLUR.Globals = {\n      \'is_authenticated\'        : f
samuelclay commented 2 years ago

The url is /api/add_site/<token>. I don't know why I put in add_url above. I'll make both work ... deployed.

samuelclay commented 2 years ago

I also fixed the issue for /api/* returning the API docs instead of 404'ing as they should have.

Dejal commented 2 years ago

This is working now. Yay. 🎉