473,229 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,229 software developers and data experts.

Locally (to the user) control bytes.com from outside of their system.

SwissProgrammer
220 128KB
I have seen similar done in a different language.

I would like this in 32 bit, C++11, not VSC++, not .net.
  1. Subclass all Firefox (or other browser) windows as soon as Microsoft Windows assigns them a temporary handle, before they are given a permanent handle.
  2. Parse the new browser window and detect the url location, etc.
  3. Run a javascript on the web page via the browser window url location box. Yes, I have literally seen this done.
  4. Detect if gits has edited an original posting for advertising, etc. Not reply postings, just the original posting. If gits has, then blank the page of ALL messages and do not waste my time showing it to me. Just put up a text line in the web page that says something like, "Spam advertising removed."

That way, it is not dependent upon Bytes.com to do this, and the editing can be used on other sites to remove other stuff.

If someone would like to write the code, that would be nice. It could be very useful maybe to millions of people.

Thanks.
Jun 5 '20 #1

✓ answered by dev7060

Not in C++ but if you're interested, the below simple JS can be used on this site with a script manager.

Expand|Select|Wrap|Line Numbers
  1. var content = document.body.textContent || document.body.innerText;
  2. var hasText = content.indexOf("Last edited by")!==-1;
  3. var hasText2 = content.indexOf("promotion")!==-1;
  4. var hasText3 = content.indexOf("spam")!==-1;
  5. var hasText4 = content.indexOf("remove promotion link")!==-1;
  6. var hasText5 = content.indexOf("remove promotional link")!==-1;
  7. if (hasText && (hasText2 || hasText3 || hasText4 || hasText5)) {
  8.     alert("Possible promotional/spam content warning!");
  9. }
The first guess was to extract the inner html/text using an ID for accurate results but the site doesn't seem to use any associated with that particular field. The above script would depend on what the moderators prefer to put in the edit/update reason area. Some common phrases have been mentioned.

Personally I don't prefer to use any of such. Been learning JS lately, so thought it'd be fun to figure out a possible way.

3 1972
dev7060
626 Expert 512MB
Not in C++ but if you're interested, the below simple JS can be used on this site with a script manager.

Expand|Select|Wrap|Line Numbers
  1. var content = document.body.textContent || document.body.innerText;
  2. var hasText = content.indexOf("Last edited by")!==-1;
  3. var hasText2 = content.indexOf("promotion")!==-1;
  4. var hasText3 = content.indexOf("spam")!==-1;
  5. var hasText4 = content.indexOf("remove promotion link")!==-1;
  6. var hasText5 = content.indexOf("remove promotional link")!==-1;
  7. if (hasText && (hasText2 || hasText3 || hasText4 || hasText5)) {
  8.     alert("Possible promotional/spam content warning!");
  9. }
The first guess was to extract the inner html/text using an ID for accurate results but the site doesn't seem to use any associated with that particular field. The above script would depend on what the moderators prefer to put in the edit/update reason area. Some common phrases have been mentioned.

Personally I don't prefer to use any of such. Been learning JS lately, so thought it'd be fun to figure out a possible way.
Jun 6 '20 #2
SwissProgrammer
220 128KB
It has been a while since I used javascript.

You are much faster at JS than I am.

Could you put this in a single line that I can copy and paste into the url location bar like this avascript:<I do not recall this part>. Then I can type in the j in front of the line (have to do it that way for built-in universal browser security rules which do not allow pasting anything starting with the word "javascript" and running it) (I think). Then hit the enter button and run the javascript to test it.

I would have just copied the entire web page to a string and looked for the part that told me that gits found advertising, then done something. I think that your way is probably faster, and maybe more adaptable to other sites and other filters. Nice.

Thanks.
Jun 6 '20 #3
dev7060
626 Expert 512MB
Not in C++ but if you're interested, the below simple JS can be used on this site with a script manager.
^^ Install a userscript manager in the browser (I prefer Greasemonkey). Then add the above script to it.
Jun 6 '20 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: CBretana | last post by:
Is it possible to programmatically control the WebPartManager without being on a web page? I need to write a C# console app that will cycle through a set of objects and for each one, generate (for...
2
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a...
12
by: Steve Blinkhorn | last post by:
Does anyone know of a way of accessing and modifying variables declared static within a function from outside that function? Please no homilies on why it's bad practice: the context is very...
3
by: tshad | last post by:
I am trying to put together a user control (.ascx). Can you access an outside control from it? My control: login2.ascx ****************************************************************...
1
by: Melisa | last post by:
Hi I have a list of all activeX controls registered on my system. When i add one of these activeX controls to Windows Form on runtime , an exception is thrown if this activeX control is not...
0
by: Diego L Espiñeira | last post by:
How do I set security for content served by the use of the classes in System.Web.Hosting namespace?
10
by: Erik Max Francis | last post by:
For a file hashing system (finding similar files, rather than identical ones), I need to be able to efficiently and quickly sum the ordinals of the bytes of a file and their squares. Because of...
1
by: python1 | last post by:
Hi All, I am using a python system command to execute a C++ executable file which takes certain binary input. For example: C++ exe name is "Test" "Test" takes the following input ....
6
by: James Hahn | last post by:
That looks like proper Property set code to me. What is the line of code that the designer is generating in the Sub InitializeComponent for a color that you select in the Properties Settings? ...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.