Sleazy Fork is available in English.

EroProfile.com Infinite Scrolling

Adds the ability to automatically load more videos, as you scroll down the page

  1. // ==UserScript==
  2. // @name EroProfile.com Infinite Scrolling
  3. // @version 3.0
  4. // @description Adds the ability to automatically load more videos, as you scroll down the page
  5. // @grant none
  6. // @include http*://www.eroprofile.com/m/videos/*
  7. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  8. // @namespace https://greasyfork.org/users/11286
  9. // ==/UserScript==
  10.  
  11. $(function() {
  12. $.addGlobalStyle = function (css) {
  13. var head, style;
  14. head = document.getElementsByTagName('head')[0];
  15. if(!head)
  16. return;
  17. style = document.createElement('style');
  18. style.type = 'text/css';
  19. style.innerHTML = css;
  20. head.appendChild(style);
  21. };
  22. $.addGlobalStyle('#divVideoListItems{height:auto;overflow:auto;}#divVideoListPageNav{height:200px!important;margin-top:20px;position:relative}#loading{position:absolute;width:256px;height:256px;top:50%;left:50%;margin:-128px 0 0 -128px;transform:scale(.6);-moz-transform:scale(.6);-webkit-transform:scale(.6);-ms-transform:scale(.6);-o-transform:scale(.6)}#loading>div{position:absolute;background-color:#E8E8E8;color:inherit;height:47px;width:47px;border-radius:23px;animation-name:map_loading;animation-duration:1.04s;animation-iteration-count:infinite;animation-direction:normal;-moz-border-radius:23px;-moz-animation-name:map_loading;-moz-animation-duration:1.04s;-moz-animation-iteration-count:infinite;-moz-animation-direction:normal;-webkit-border-radius:23px;-webkit-animation-name:map_loading;-webkit-animation-duration:1.04s;-webkit-animation-iteration-count:infinite;-webkit-animation-direction:normal;-ms-border-radius:23px;-ms-animation-name:map_loading;-ms-animation-duration:1.04s;-ms-animation-iteration-count:infinite;-ms-animation-direction:normal;-o-border-radius:23px;-o-animation-name:map_loading;-o-animation-duration:1.04s;-o-animation-iteration-count:infinite;-o-animation-direction:normal}#loading>div:nth-child(1){left:0;top:105px;animation-delay:.39s;-moz-animation-delay:.39s;-webkit-animation-delay:.39s;-ms-animation-delay:.39s;-o-animation-delay:.39s}#loading>div:nth-child(2){left:30px;top:30px;animation-delay:.52s;-moz-animation-delay:.52s;-webkit-animation-delay:.52s;-ms-animation-delay:.52s;-o-animation-delay:.52s}#loading>div:nth-child(3){left:105px;top:0;animation-delay:.65s;-moz-animation-delay:.65s;-webkit-animation-delay:.65s;-ms-animation-delay:.65s;-o-animation-delay:.65s}#loading>div:nth-child(4){right:30px;top:30px;animation-delay:.78s;-moz-animation-delay:.78s;-webkit-animation-delay:.78s;-ms-animation-delay:.78s;-o-animation-delay:.78s}#loading>div:nth-child(5){right:0;top:105px;animation-delay:.91s;-moz-animation-delay:.91s;-webkit-animation-delay:.91s;-ms-animation-delay:.91s;-o-animation-delay:.91s}#loading>div:nth-child(6){right:30px;bottom:30px;animation-delay:1.04s;-moz-animation-delay:1.04s;-webkit-animation-delay:1.04s;-ms-animation-delay:1.04s;-o-animation-delay:1.04s}#loading>div:nth-child(7){left:105px;bottom:0;animation-delay:1.17s;-moz-animation-delay:1.17s;-webkit-animation-delay:1.17s;-ms-animation-delay:1.17s;-o-animation-delay:1.17s}#loading>div:nth-child(8){left:30px;bottom:30px;animation-delay:1.3s;-moz-animation-delay:1.3s;-webkit-animation-delay:1.3s;-ms-animation-delay:1.3s;-o-animation-delay:1.3s}@-moz-keyframes map_loading{0%{background-color:#0069C6}100%{background-color:transparent}}@-webkit-keyframes map_loading{0%{background-color:#0069C6}100%{background-color:transparent}}@-ms-keyframes map_loading{0%{background-color:#0069C6}100%{background-color:transparent}}@-o-keyframes map_loading{0%{background-color:#0069C6}100%{background-color:transparent}}@keyframes map_loading{0%{background-color:#0069C6}100%{background-color:transparent}}');
  23. $.urlParam = function(name) {
  24. var results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.href);
  25. if(results === null)
  26. return null;
  27. else
  28. return results[1] || 0;
  29. };
  30. var loading = false;
  31. $('.boxNav2').hide();
  32. $('<div/>', {
  33. id: 'loading'
  34. }).appendTo('#divVideoListPageNav');
  35. for(var i = 0; i < 8; i++) {
  36. $('<div/>').appendTo('#loading');
  37. }
  38. $(window).on('scroll', function() {
  39. var end = $('#divVideoListAd2').offset().top;
  40. var viewEnd = $(window).scrollTop() + $(window).height();
  41. var distance = end - viewEnd;
  42. if(distance <= 0) {
  43. if(loading === false) {
  44. loading = true;
  45. $('#divVideoListPageNav').show();
  46. var params = '';
  47. var niche = $.urlParam('niche');
  48. if(niche)
  49. params += '&niche=' + niche;
  50. var text = $.urlParam('text');
  51. if(text)
  52. params += '&text=' + text;
  53. var pnum = parseInt($.urlParam('pnum')) || 1;
  54. var new_pnum = pnum + 1;
  55. params += '&pnum=' + new_pnum;
  56. new_url = '?' + params.substring(1);
  57. $.ajax({
  58. url: 'https://www.eroprofile.com/m/videos/' + new_url,
  59. type: 'post',
  60. dataType: 'html',
  61. success: function(data) {
  62. $(data).find('div.video').appendTo('#divVideoListItems > .videoGrid');
  63. window.history.pushState('', '', new_url);
  64. $('#divVideoListPageNav').hide();
  65. loading = false;
  66. }
  67. });
  68. }
  69. }
  70. });
  71. });