Skip to content

Instantly share code, notes, and snippets.

@SiZapPaaiGwat
Created May 17, 2017 06:30
Show Gist options
  • Save SiZapPaaiGwat/ab30300feb2e2c1958a1ab9d7d9b7a31 to your computer and use it in GitHub Desktop.
Save SiZapPaaiGwat/ab30300feb2e2c1958a1ab9d7d9b7a31 to your computer and use it in GitHub Desktop.
Try to help you make money in the stock market
// ==UserScript==
// @name SnowBallHelper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to help you make money in the stock market
// @author Simon
// @include /^https:\/\/xueqiu\.com\/\d+#?/
// @grant none
// ==/UserScript==
(function () {
'use strict';
var url = 'http://www.iwencai.com/stockpick/search?typed=1&preParams=&ts=1&f=1&qs=index_rewrite&selfsectsn=&querytype=&searchfilter=&tid=stockpick&w=';
var html = '<div style="border: 1px solid #e4f2ff;padding: 6px;border-top: 0;">' +
'<a id="__wcxg" title="选股找问财,一句话的事儿" target="_blank" href="javascript:;"><img style="width: 16px; height: 16px;" src="https://www.iwencai.com/favicon.ico" /></a>' +
'</div>';
$('.portfolio-stocks').last().after(html);
$('#__wcxg').on('click', function () {
var rows = [];
$('.stock-list tbody tr').each(function () {
var id = $(this).attr('data-symbol');
if (id && id.length === 8 && /^[SH|SZ]+\d{6}$/.test(id)) {
rows.push(id.slice(2));
}
});
var href = 'javascript:;';
if (rows.length > 0) {
href = url + rows.join(' ') + '连续十年净利润,市盈率TTM';
}
$(this).attr('href', href);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment