Skip to content
This repository was archived by the owner on Feb 29, 2020. It is now read-only.

but 1520262 - v1 personalization for regular feeds.#4911

Merged
ScottDowne merged 10 commits intomozilla:masterfrom
ScottDowne:t-1520262
Apr 23, 2019
Merged

but 1520262 - v1 personalization for regular feeds.#4911
ScottDowne merged 10 commits intomozilla:masterfrom
ScottDowne:t-1520262

Conversation

@ScottDowne
Copy link
Copy Markdown
Collaborator

No description provided.

@ScottDowne
Copy link
Copy Markdown
Collaborator Author

ScottDowne commented Apr 18, 2019

Steps to test:

  1. Create a brand new profile.
  2. Visit:

http://softpedia.com
http://speedtest.net
http://chip.de
http://cultofmac.com
http://majorgeeks.com
http://9to5mac.com
http://tomshardware.com
http://xda-developers.com
http://sourceforge.net
http://pcmag.com
http://techradar.com
http://tomsguide.com
http://cloudwards.net
http://softwarehow.com
http://macworld.com
http://trusted.de
http://howtogeek.com
http://spiceworkds.com
http://carbonite.com
http://actifio.com
http://asigra.com
http://software.dell.com
http://evault.com
http://falconstor.com
http://intronis.com
http://netapp.com
http://unitrends.com
http://veeam.com
http://veritas.com

  1. Close those tabs and restart the browser.
  2. Go to about:config
  3. Change this pref: browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  4. Change this pref: browser.newtabpage.activity-stream.discoverystream.endpoints to http,file
  5. Change this pref: browser.newtabpage.activity-stream.discoverystream.config to {"api_key_pref":"extensions.pocket.oAuthConsumerKey","enabled":true,"show_spocs":false,"personalized":true,"layout_endpoint":"https://gist.githubusercontent.com/ScottDowne/92dc05d0e99cba6897409b66a2a10342/raw/cfb114a71125a8be0a7cc0854bb02e475abecd20/p-v1-layout-2"}
  6. Enter this into the global browser console (not the console for the single page) Services.obs.notifyObservers(null, "idle-daily");
  7. Restart the browser again.
  8. Change this pref: browser.newtabpage.activity-stream.discoverystream.config to {"api_key_pref":"extensions.pocket.oAuthConsumerKey","enabled":true,"show_spocs":false,"personalized":true,"layout_endpoint":"https://gist.githubusercontent.com/ScottDowne/92dc05d0e99cba6897409b66a2a10342/raw/cfb114a71125a8be0a7cc0854bb02e475abecd20/p-v1-layout-2" } (yes, we're using almost the same pref. There is a slight difference in there to force an update)
  9. Open about:newtab#devtools-ds
  10. Scroll to the down that page until you see "Feeds Data" with a url and the id 36451 (there should be only one)
  11. Open it up.
  12. Look for score and item_score in the data, they should be different. I'm getting "item_score": 0.1, "score": 0.0505 The reason why it's lower is because I only had you test 1 url in the history. This is to save us all time in testing. If I made a feed with many domains and had you open many tabs, we could get that number to 1.0

@ScottDowne ScottDowne requested a review from gvn April 18, 2019 17:47
};

export class ToggleSpocButton extends React.PureComponent {
export class ToggleStoryButton extends React.PureComponent {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now generic for stories of all types, recs and spocs. So needed a name change.

return isMatch;
}

renderFeedData(url) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are now showing feed data, along with spoc data, to test that the score changes.

this.componentFeedFetched = true;
feed = {
lastUpdated: Date.now(),
data: this.rotate(feedResponse),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rotate was unpacking the response, making changes to data, and repacking it.

I changed it so rotate takes the items, rotates them, and returns them. I then repackage it after calling it.

this was needed because I'm needing to call scoreItems now for both spocs and recs, but I only want to do rotate on recs, and rotate wasn't clumsy, I would have needed to make score items also unpack and repack, causing a bunch of pointless packing of the object.

This also meant I needed to make some changes to the way spocs call scoreItems.

@gvn
Copy link
Copy Markdown
Contributor

gvn commented Apr 22, 2019

Look for score and item_score in the data, they should be different. I'm getting "item_score": 0.1, "score": 0.0505 The reason why it's lower is because I only had you test 1 url in the history. This is to save us all time in testing. If I made a feed with many domains and had you open many tabs, we could get that number to 1.0

I'm seeing 0.1 for both item_score and score after following all your steps.

Complete object for 36451:

{
  "id": 36451,
  "url": "https://getpocket.com/explore/item/are-you-forgetful-that-s-just-your-brain-erasing-useless-memories",
  "domain": "theverge.com",
  "title": "Are you forgetful? That's just your brain erasing useless memories",
  "excerpt": "Most of us think “perfect” memory means never forgetting, but maybe forgetting actually helps us navigate a world that is random and ever-changing.",
  "image_src": "https://img-getpocket.cdn.mozilla.net/direct?url=https%3A%2F%2Fpocket-image-cache.com%2Fdirect%3Furl%3Dhttps%253A%252F%252Fpocket-image-cache.com%252Fdirect%253Fresize%253Dw2000%2526url%253Dhttps%25253A%25252F%25252Fcdn.vox-cdn.com%25252Fuploads%25252Fchorus_image%25252Fimage%25252F55369977%25252Fbrainuse.0.png%26resize%3Dw1000&resize=w450",
  "published_timestamp": "1498021200",
  "parameter_set": "fully-personalized",
  "domain_affinities": {
    "centauri-dreams.org": "1.0000"
  },
  "item_score": 0.1,
  "raw_image_src": "https://pocket-image-cache.com/direct?url=https%3A%2F%2Fpocket-image-cache.com%2Fdirect%3Fresize%3Dw2000%26url%3Dhttps%253A%252F%252Fcdn.vox-cdn.com%252Fuploads%252Fchorus_image%252Fimage%252F55369977%252Fbrainuse.0.png&resize=w1000",
  "score": 0.1,
  "min_score": 0,
  "pos": 0
}

@ScottDowne
Copy link
Copy Markdown
Collaborator Author

I updated the steps, mind trying again?

it's super fickle.

@gvn
Copy link
Copy Markdown
Contributor

gvn commented Apr 23, 2019

With the updated repro steps I get:

{
  "id": 36451,
  "url": "https://getpocket.com/explore/item/are-you-forgetful-that-s-just-your-brain-erasing-useless-memories",
  "domain": "theverge.com",
  "title": "Are you forgetful? That's just your brain erasing useless memories",
  "excerpt": "Most of us think “perfect” memory means never forgetting, but maybe forgetting actually helps us navigate a world that is random and ever-changing.",
  "image_src": "https://img-getpocket.cdn.mozilla.net/direct?url=https%3A%2F%2Fpocket-image-cache.com%2Fdirect%3Furl%3Dhttps%253A%252F%252Fpocket-image-cache.com%252Fdirect%253Fresize%253Dw2000%2526url%253Dhttps%25253A%25252F%25252Fcdn.vox-cdn.com%25252Fuploads%25252Fchorus_image%25252Fimage%25252F55369977%25252Fbrainuse.0.png%26resize%3Dw1000&resize=w450",
  "published_timestamp": "1498021200",
  "parameter_set": "fully-personalized",
  "domain_affinities": {
    "softpedia.com": 1,
    "speedtest.net": 1,
    "chip.de": 1,
    "cultofmac.com": 1,
    "majorgeeks.com": 1,
    "9to5mac.com": 1,
    "tomshardware.com": 1,
    "xda-developers.com": 1,
    "sourceforge.net": 1,
    "pcmag.com": 1,
    "techradar.com": 1,
    "tomsguide.com": 1,
    "cloudwards,net": 1,
    "softwarehow.com": 1,
    "macworld.com": 1,
    "trusted.de": 1,
    "howtogeek.com": 1,
    "spiceworkds.com": 1,
    "carbonite.com": 1,
    "actifio.com": 1,
    "asigra.com": 1,
    "software.dell.com": 1,
    "evault.com": 1,
    "falconstor.com": 1,
    "intronis.com": 1,
    "netapp.com": 1,
    "unitrends.com": 1,
    "veeam.com": 1,
    "veritas.com": 1
  },
  "item_score": 0.1,
  "raw_image_src": "https://pocket-image-cache.com/direct?url=https%3A%2F%2Fpocket-image-cache.com%2Fdirect%3Fresize%3Dw2000%26url%3Dhttps%253A%252F%252Fcdn.vox-cdn.com%252Fuploads%252Fchorus_image%252Fimage%252F55369977%252Fbrainuse.0.png&resize=w1000",
  "score": 0.991,
  "min_score": 0,
  "pos": 0
}

Copy link
Copy Markdown
Contributor

@gvn gvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, so if you're satisfied with the object then I'd say R+!

@ScottDowne ScottDowne merged commit aab9163 into mozilla:master Apr 23, 2019
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