Bitcoin Forum
May 06, 2024, 07:28:49 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 »
1  Other / Meta / Python script to automatically delete or edit all bitcointalk posts on: October 07, 2023, 01:22:18 PM
Since you cant delete your account here, and deleting posts manually one by one is a pain, i made a python script to automatically delete all posts that can be deleted, and to edit those which can only be edited (changes subject and message to "x")

I couldnt find any terms of service for this website, so not sure if this is even allowed.


Requirements
Python
Chrome (you can edit the script yourself to change browser if you want)
Selenium installed in python
Code:
pip install selenium

How to use
After installing selenium, simply run the python script, it will ask you how many pages of posts your account has (Profile -> Show Posts -> Highest page number available)
just enter the number you see in your profile and then hit enter. It will then open up a chrome browser with the login page for bitcointalk open, you will have 60 seconds to log in and when the 60 seconds are up, the script will start deleting and editing posts from your profile.
Note: When logging in, you should set number of minutes to be logged in to a higher number if you have many posts

WARNING
This should be obvious, but running this script will try to delete as many of your posts as it can, so dont run it if you dont want that..

Code: https://github.com/SwayStar123/del_btctalk_posts

Code:
import re
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException

def extract_ids_from_url(post_url):
    # Splitting the URL based on "?"
    parameters = post_url.split('?')[1]
   
    # Extracting topic and msg IDs from the parameters
    topic_id = parameters.split('.msg')[0].split('topic=')[1]
    msg_id = parameters.split('.msg')[1].split('#')[0]
   
    return topic_id, msg_id

def delete_post(browser, post_url, sesc_token):
    topic_id, msg_id = extract_ids_from_url(post_url)
   
    # Constructing the delete URL
    delete_url = f"https://bitcointalk.org/index.php?action=deletemsg;topic={topic_id}.0;msg={msg_id};sesc={sesc_token}"

    browser.get(delete_url)

    time.sleep(1)

    if browser.current_url == f"https://bitcointalk.org/index.php?topic={topic_id}.0":
        return True
    else:
        return False

def edit_post(browser, post_url, sesc_token):
    topic_id, msg_id = extract_ids_from_url(post_url)
       
    # Navigate to edit URL
    edit_url = f"https://bitcointalk.org/index.php?action=post;msg={msg_id};topic={topic_id}.0;sesc={sesc_token}"
    browser.get(edit_url)
   
    try:
        # Change the subject to "x"
        subject_elem = WebDriverWait(browser, 2).until(
            EC.presence_of_element_located((By.NAME, 'subject'))
        )
        subject_elem.clear()
        subject_elem.send_keys('x')
       
        # Change the message content to "x"
        message_elem = WebDriverWait(browser, 2).until(
            EC.presence_of_element_located((By.NAME, 'message'))
        )
        message_elem.clear()
        message_elem.send_keys('x')
       
        # Click the Save button
        save_button = WebDriverWait(browser, 2).until(
            EC.presence_of_element_located((By.NAME, 'post'))
        )
        save_button.click()
       
    except Exception as e:
        print(f"Error editing post: {e}")
   
    time.sleep(0.5)  # Introduce a delay before processing the next post or action


def scrape_post_urls(browser, start):
    browser.get(BASE_URL + str(start))
    post_urls = []
    try:
        # Target <a> elements within <td> of class 'middletext' and get the third (last) link
        post_elements = WebDriverWait(browser, 10).until(
            EC.presence_of_all_elements_located((By.XPATH, '//td[@class="middletext"]/a[3]'))
        )
        for post_element in post_elements:
            post_urls.append(post_element.get_attribute("href"))
    except Exception as e:
        print(f"Error scraping post URLs at start={start}: {e}")
    return post_urls

def extract_sesc_token(browser):
    # Go to the homepage or any page where the logout link is visible
    browser.get("https://bitcointalk.org/index.php")
    try:
        # Locate the logout link and extract the sesc token from its href attribute
        logout_link = WebDriverWait(browser, 10).until(
            EC.presence_of_element_located((By.XPATH, '//a[contains(@href, "action=logout")]'))
        )
        href = logout_link.get_attribute('href')
        sesc_token = href.split('sesc=')[1]
        return sesc_token
    except Exception as e:
        print(f"Error extracting sesc token: {e}")
        return None

def extract_user_id(browser):
    # Navigate to main profile page
    browser.get('https://bitcointalk.org/index.php?action=profile')
   
    try:
        # Extracting the URL of the 'Account Related Settings' link
        account_related_settings_url = WebDriverWait(browser, 10).until(
            EC.presence_of_element_located((By.XPATH, '//a[contains(text(), "Account Related Settings")]'))
        ).get_attribute('href')
       
        # Extracting the user ID from the URL
        user_id = re.search(r'u=(\d+)', account_related_settings_url).group(1)
        return user_id
   
    except (TimeoutException, AttributeError):
        print("Failed to extract user ID.")
        return None
   
if __name__ == '__main__':
    num_pages = int(input("How many pages of posts do you have in your profile?: "))

    browser = webdriver.Chrome()

    # Navigate to login page or homepage
    browser.get("https://bitcointalk.org/index.php?action=login")
    print("Please login manually within the next 60 seconds...")
    time.sleep(60)  # Give 60 seconds for manual login

    # Extract user ID
    user_id = extract_user_id(browser)

    if not user_id:
        print("Failed to extract user ID.")
        browser.quit()
        exit()

    BASE_URL = f'https://bitcointalk.org/index.php?action=profile;u={user_id};sa=showPosts;start='

    sesc_token = extract_sesc_token(browser)
    if sesc_token:
        print(f"Extracted sesc token: {sesc_token}")

        # Continue with rest of your logic, e.g., scraping post URLs and deleting posts
        all_post_urls = []
        for start in range(0, num_pages*20, 20):
            all_post_urls.extend(scrape_post_urls(browser, start))

        for post_url in all_post_urls:
            res = delete_post(browser, post_url, sesc_token)
            if res == True:
                continue
            else:
                edit_post(browser, post_url, sesc_token)
    else:
        print("Failed to extract sesc token.")
   
    browser.quit()
2  Alternate cryptocurrencies / Service Discussion (Altcoins) / x on: May 24, 2021, 05:56:38 PM
x
3  Economy / Auctions / Re: Advertise on this forum - Round 339 on: May 20, 2021, 07:42:28 PM
5 @ 2mBTC
http://telega.io/ - Telegram Ad Exchange

I want to cancel a bid

Your bid was invalid from the beginning, all the bids were at 2 mBTC, all 9 slots were bid on and you were the latest, meaning the previous bidders get priority
4  Alternate cryptocurrencies / Service Discussion (Altcoins) / x on: May 19, 2021, 09:41:55 AM
x
5  Alternate cryptocurrencies / Speculation (Altcoins) / x on: May 14, 2021, 07:04:47 AM
x
6  Bitcoin / Bitcoin Discussion / x on: May 04, 2021, 06:35:26 AM
x
7  Other / Meta / Should merit be disabled on Bitcoin Wall Observer? on: September 04, 2020, 04:04:18 AM
Congrats to both JSRAW and d_eddie. Well deserved and welcome to the club.
Toxic on deck.

Lesson 1 on how to become a bitcointalk legendary...

-Hang out in the wob thread.
-don't spam,
-don't commit shitcoinery....
-and don't be a dick.

(I know... I can be a dick, but I was grandfathered in...)

This was my original motivation to write this thread, I have not engaged in the BWO thread much, but from my limited engagement of that thread, I can tell it was an extremely toxic community, its hard enough to get into their community of <20 people, but if you post ANY bearish TA on the thread, you will be absolutely ostracized, especially if you are not part of their upper echelon. So I have come here to make my case on whether or not this community really deserves their 11000+ merits that has been circulating between each other.

Lets look at original intent of the Wall Observer thread and how it holds up now

Wall Observer
A free service brought to you by the bitcoin community

Whenever there is a significant change in market depth, please update this thread with a new depth chart, and a good price chart with some TA is also welcome, feel free to comment on these if you have something to worth contributing, ( if your post is not at all TA it will be deleted )

Posting guild lines:
 Please lets keep this thread clean. ( I will be removing any off topic posts )
 Do not post random comments on this thread, unless it is directly related to the last wall update (ex. The 20K ask was was NOT sold into, it was removed after being tested)
 When you post a chart please use bitcoincharts.com, mtgoxlive.com, btccharts.com or bitcoinity.com (This information may be out of date)

Recommendations
Do: Post TA and news items related to Bitcoin, engage in friendly debate and banter, ignore people who offend or insult you
Don't: Be a drama queen

lets look at the first line for now
Quote
Whenever there is a significant change in market depth, please update this thread with a new depth chart, and a good price chart with some TA is also welcome, feel free to comment on these if you have something to worth contributing

Now even at a quick glance of the last few pages of the BWO thread, its quite apparent that almost 80% of the posts are completely irrelevant to the bitcoin price, while there is some (still not a majority) of discussion about bitcoin in general, the vast majority of the talk on BWO is irrelevant to the subject at hand.

Quote
( if your post is not at all TA it will be deleted )
Anyone with half an eye will be able to tell this has not been followed for a very long time, i dont really blame infofront, as there are ALOT of posts, but the fact that he let it slide at the start has caused this massive problem to begin with.

Quote
Please lets keep this thread clean. ( I will be removing any off topic posts )

same as above

Quote
Do not post random comments on this thread, unless it is directly related to the last wall update (ex. The 20K ask was was NOT sold into, it was removed after being tested)

same as above

Quote
Don't: Be a drama queen

There is quite a bit of drama in the thread, theres people berating others for posting bearish TA, and then theres people throwing shit at each other for not holding up a (joke) offer of beer if price fell below a certain price.

In conclusion, most of WBO is just banter/jokes or just plain chit chat, the only person I could find who consistently posts TA is Toxic2040, and so I would like to make it clear, I have no problem with Toxic2040, only with the rest of the WBO community.


Now all of this would be fine and dandy under normal circumstances, I really wouldn't give a shit if there was a toxic community doing whatever they want, my main issue comes from the merit circulation within this thread.

Let us look at the original purpose of merit

What is Merit?

Merit is a new system created in order to reward quality contributions to the forum.

The original purpose of merit was to reward quality contributions to this forum... Let us now see how this holds up on BWO

I will now share the last few merited posts from WBO, im not gonna be picking and choosing.

Once more for the people in the back...bitcoin cannot sustain prices greater than $10k. It's nothing more than a fantasy. Proven by science and maths.

Idiots like you is why I am proud of having suffered through an actual physics degree instead of lying to people on internet forums about what math and science have "proven". And I think you meant to say disproven. Because the first thing they tell young scientists: you cannot prove something. You can only disprove something.

2 merits, irrelevant to bitcoin price, does not add anything to the actual arguement for any price movement, and is mostly just random. I would not deem this a quality contribution.

Once more for the people in the back...bitcoin cannot sustain prices greater than $10k. It's nothing more than a fantasy. Proven by science and maths.

Finally!!!!!!

A positive sign.  

aka... proudhon


 Wink

This never really gets old

https://www.youtube.com/watch?v=A7TuFy0fcuw

The proudhon song (bitcoin is a bubble)

1 merit, again irrelevant to bitcoin price, its just mainly banter, i dont see how this would qualify as a quality contribution.

Once more for the people in the back...bitcoin cannot sustain prices greater than $10k. It's nothing more than a fantasy. Proven by science and maths.

Finally!!!!!!

A positive sign.  

aka... proudhon


 Wink

1 merit, once again, just banter

Well i think you get the point, lets now look at the merit flow for one of the WBO regulars..




this is not an isolated case, nearly all the WBO regulars get all their merit from WBO and send all their merit back into WBO, this is basically due to a feedback loop, WBO members meriting each other because "haha funny joke" rather than any posts being of actual significance which add something to the discussion or forum

This basically means that merit has become insanely inflated in WBO and legendary rank has become relatively easy to earn, really demeaning the value of the rank, legendary rank was supposed to be reserved for people who get merited alot due to their contributions to this forum, but due to WBO, there have been alot of new legendaries who really just got alot of merits because they pleased the WBO community and participated in the echoing of their opinions between each other, This is problem is also exaggerated due to signature campaigns, legendary rank members can gain a very high price for their signature, which also rewards the members of WBO and provides them incentive to continue this practice.



If any of you disagree with me and think im wrong for any reasons, feel free to reply here, I would like to hear your arguements.

edit: changed title from "Should bitcoin wall observer thread be deleted" to "should merit be disabled on bitcoin wall observer"
8  Economy / Speculation / x on: August 19, 2020, 11:24:55 AM
x
9  Economy / Speculation / x on: June 12, 2020, 12:14:30 PM
x
10  Economy / Games and rounds / Any bernie supporters want to bet? Offering 3:1 odds on: April 03, 2020, 09:38:23 AM
If you believe that bernie will win the 2020 elections, I am offering 3:1 odds on a bet, If bernie wins the election you get 3x the initial bet, and nothing if he loses  Grin (Im not offering bets against bernie, only in favour of him) (It is for the presidential elections)

I will only be taking the bets in ethereum at this address- 0x854058553dF87EF1bE2c1D8f24eEa8AF52A81fF1

Maximum bet size is 1 ETH

I will publicly keep track of all the bets but If you desire I can privately keep track of your bet.

You must post a signed message from the address you send me the ethereum from so I know it is you.

For now Its empty, but I will update it later - http://prntscr.com/rs63pb
11  Other / Meta / x on: April 01, 2020, 08:22:47 AM
x
12  Economy / Speculation / x on: March 12, 2020, 07:50:49 PM
x
13  Economy / Speculation / x on: March 12, 2020, 07:45:31 PM
x
14  Economy / Lending / Can i get a loan with my account as collateral? (Member with 59 merit) on: March 10, 2020, 04:57:47 PM
Is anyone willing to give a loan? Its not a large amount (0.05>) I saw there are some no collateral loans but they are for Sr. Members +, so was wondering if any such service for just Members
15  Economy / Trading Discussion / x on: March 10, 2020, 01:01:22 PM
x
16  Economy / Speculation / x on: March 10, 2020, 12:47:18 PM
x
17  Economy / Speculation / x on: March 08, 2020, 02:10:04 PM
x
18  Bitcoin / Development & Technical Discussion / x on: March 07, 2020, 10:43:34 AM
x
19  Economy / Auctions / Re: Domain Name: Binance.Exchange on: March 01, 2020, 02:40:17 PM
whats the proof that you have this domain
20  Other / Meta / x on: March 01, 2020, 02:36:05 PM
x
Pages: [1] 2 3 4 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!