Bitcoin Forum
April 30, 2024, 05:39:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Self hosted API's for regular signature editing?  (Read 227 times)
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 06:34:17 PM
Merited by El duderino_ (7), LoyceV (4), hugeblack (4), TryNinja (3), vapourminer (2), JayJuanGee (1), ABCbits (1), DdmrDdmr (1)
 #1

Would self-hosting an API (or something) that managed my signature be frowned upon?

For example, having a price ticker scape BTC price and update it in text/BB format every 30 mins via tapermonkey or something like that to my signature destination.

http://html/body/div[2]/table/tbody/tr/td[2]/form/table/tbody/tr[3]/td/table/tbody/tr[13]/td[2]/textarea

this is just one way to go about it. I could explore unofficial Api's and see what could be conjured up.

I guess my main concern is even if this is fair game, would it be frowned upon it changing so much?

I could see it potentially causing confusion in archives and stuff,
 
or just being annoying if a color changed or something every 30 mins even if I'm not posting.

I'd like to tinker with the notion though!

I've been thinking for years of something different and neat to attempt involving signatures.


  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714498744
Hero Member
*
Offline Offline

Posts: 1714498744

View Profile Personal Message (Offline)

Ignore
1714498744
Reply with quote  #2

1714498744
Report to moderator
1714498744
Hero Member
*
Offline Offline

Posts: 1714498744

View Profile Personal Message (Offline)

Ignore
1714498744
Reply with quote  #2

1714498744
Report to moderator
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6973



View Profile WWW
December 09, 2023, 06:40:56 PM
Merited by vapourminer (1), JayJuanGee (1)
 #2

Would self-hosting an API (or something) that managed my signature be frowned upon?
I don't think so. The forum allows bots if they follow the 1 request per second rule.

My archive doesn't track signatures and (AFAIK) neither does BPIP. Loyce's only does that for managers that hire his services.

I've never thought of that, interesting idea.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 06:48:10 PM
 #3

Would self-hosting an API (or something) that managed my signature be frowned upon?
I don't think so. The forum allows bots if they follow the 1 request per second rule.

My archive doesn't track signatures and (AFAIK) neither does BPIP. Loyce's only does that for managers that hire his services.

I've never thought of that, interesting idea.

Crazy...I'm on your GreasyFork page , came back and you chimed in!

I'm particularly interested in https://greasyfork.org/en/scripts/465886-bitcointalk-image-upload-button-talkimg

I'm thinking things like a halving countdown, only updates on a new block for example.

Or an easy price tracker, once every 30 mins. Nothing actually "Live".

  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
hugeblack
Legendary
*
Offline Offline

Activity: 2492
Merit: 3623


Buy/Sell crypto at BestChange


View Profile WWW
December 09, 2023, 07:24:51 PM
Merited by JayJuanGee (1)
 #4

If I understood you correctly, you are talking about something like:



Code:
If I understood you correctly, you are talking about something like:
source ---> https://bitcointalk.org/index.php?topic=5445282.0

Signatures have many restrictions, such as inserting an image, so I think that any API code would be difficult, or at least difficult, to create a dynamic signature.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 07:46:00 PM
Merited by El duderino_ (5), vapourminer (4), LoyceV (4), JayJuanGee (1), TryNinja (1)
 #5

If I understood you correctly, you are talking about something like:



Code:
If I understood you correctly, you are talking about something like:
source ---> https://bitcointalk.org/index.php?topic=5445282.0

Signatures have many restrictions, such as inserting an image, so I think that any API code would be difficult, or at least difficult, to create a dynamic signature.
Something like this yes, but instead of an image it relays the data in human readable format but inserts it into signature for you via script if change is detected from orgin source or a callout for every hour or something.

think of an block tracker on your signature but since we cant do images we have to get console to automatically update your sig (after communicating with a url or api) every 30 mins with the current block.

Or a price ticker.    or a new article from a bitcoin newspaper that allows api's/scraping. or a combination of all the above.


An example of how the signature itself would look.

BTCitcoin Price 43,999
Halving countdown! 135 Days! 
Current Block No 820,459

italic fields could be targeted/changed via api/console.


 




  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6973



View Profile WWW
December 09, 2023, 07:58:02 PM
Merited by LoyceV (4), vapourminer (1), JayJuanGee (1)
 #6

I was thinking of an automated pay-per-day signature4rent service.

Something like:

1. You go to rentsignature.ninjastic.space;
2. You paste the bbcode for your signature (and maybe even personal text or avatar);
3. You get a BTC address to pay to;
4. You send $150 in BTC for 1 week;
5. A bot keeps track of the time left and switches up my signature when it needs to.

Caution would be needed so a troll can't add ilegal stuff on your signature, maybe some quick moderation where your signature needs to be approved. Also, opening this to other users would require them to send their password over.

I might code this just for fun (very very very likely won't use it on my account).

Cheesy

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 08:08:23 PM
 #7

I was thinking of an automated pay-per-day signature4rent service.

Something like:

1. You go to rentsignature.ninjastic.space;
2. You paste the bbcode for your signature (and maybe even personal text or avatar);
3. You get a BTC address to pay to;
4. You send $150 in BTC for 1 week;
5. A bot keeps track of the time left and switches up my signature when it needs to.

Caution would be needed so a troll can't add ilegal stuff on your signature, maybe some quick moderation where your signature needs to be approved. Also, opening this to other users would require them to send their password over.

I might code this just for fun (very very very likely won't actually use it on my account, though).

Cheesy

I started on that idea, and the question was how to change the signature automatically, easily then I started complicating stuff with updateable metrics.

I have no doubt "You" could pull that off. (on your own profile)

But I dont know of anyone that would give a password for something like that unless LoyceV would do their secondary mobile acc for ex.

Making a signature editor seems like a necessity for any of these ideas regardless. You could eliminate the need for password with a GF/TM script though, right point and shoot (for your scenario)?






  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6973



View Profile WWW
December 09, 2023, 08:15:12 PM
Merited by JayJuanGee (1)
 #8

I have no doubt "You" could pull that off. (on your own profile)

But I dont know of anyone that would give a password for something like that unless LoyceV would do their secondary mobile acc for ex.
Of course, that's why I never released a built-in DM notification on the SuperNotifier bot.

[...] and the question was how to change the signature automatically [...]
That wouldn't be a problem.

Login, get cookies, then POST https://bitcointalk.org/index.php?action=profile2 with a FormData containing all parameters for the profile form, which include personalText and signature. You can get them by checking your browser's developer tools "Network" tab for the request after editing your profile.

If it's running on a userscript (i.e tampermonkey), all you need to do is create a loop that fetches your block height data and then do the above with the right bbcode string.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 08:24:37 PM
 #9

I have no doubt "You" could pull that off. (on your own profile)

But I dont know of anyone that would give a password for something like that unless LoyceV would do their secondary mobile acc for ex.
Of course, that's why I never released a built-in DM notification on the SuperNotifier bot.

[...] and the question was how to change the signature automatically [...]
That wouldn't be a problem.

Login, get cookies, then POST https://bitcointalk.org/index.php?action=profile2 with a FormData containing all parameters for the profile form, which include personalText and signature. You can get them by checking your browser's developer tools "Network" tab for the request after editing your profile.

If it's running on a userscript (i.e tampermonkey), all you need to do is create a loop that gets your block height data and then do the above with the right bbcode string.

Thanks!

I started liking your idea more though.

 What if you created a user network where everyone can wear the sigs you collect on your portal and they get 80% of what was paid for that ad (proportionally) track metric with a small pixel style snippet in the sig?

Might need a new sub set of signature rules to fit the extra tracker but I could see campaign managers eating something like this up.

  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
LoyceMobile
Hero Member
*****
Offline Offline

Activity: 1654
Merit: 687


LoyceV on the road. Or couch.


View Profile WWW
December 09, 2023, 08:45:42 PM
Merited by JayJuanGee (1)
 #10

You can't have a tracking pixel in a signature.

LoyceV on the road Advertise here for LN Don't deal with this account (exception)
Advertise here for LN Tip my kids Exchange LN (20 coins). 1% fee. No KYC <€50/month
My useful topics: Meritt & Trust & Moreee Art Advertise here for LN Foru[url=https://bitcointalk.org/m
vapourminer
Legendary
*
Offline Offline

Activity: 4312
Merit: 3518


what is this "brake pedal" you speak of?


View Profile
December 09, 2023, 09:10:27 PM
Merited by JayJuanGee (1)
 #11

You can't have a tracking pixel in a signature.

i didnt think you could have a tracking pixel anywhere in the forum; wasnt that the whole point of the forum image proxy setup?
LoyceMobile
Hero Member
*****
Offline Offline

Activity: 1654
Merit: 687


LoyceV on the road. Or couch.


View Profile WWW
December 09, 2023, 09:14:15 PM
Merited by vapourminer (1)
 #12

i didnt think you could have a tracking pixel anywhere in the forum; wasnt that the whole point of the forum image proxy setup?
You can track page access, but not ip address.

LoyceV on the road Advertise here for LN Don't deal with this account (exception)
Advertise here for LN Tip my kids Exchange LN (20 coins). 1% fee. No KYC <€50/month
My useful topics: Meritt & Trust & Moreee Art Advertise here for LN Foru[url=https://bitcointalk.org/m
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 09, 2023, 09:23:36 PM
Merited by vapourminer (1)
 #13

i didnt think you could have a tracking pixel anywhere in the forum; wasnt that the whole point of the forum image proxy setup?
You can track page access, but not ip address.
I said a pixel style snippet. like a user code for that campaign. It would just be used for tracking the sig. not how google designed em.

Meaning a tracker.   for example a users sig would have that snippet in it , ninjastic would see how many times that snippet was posted for that user and automatically detect if the signature was equipped on post and how many times a post made with that code attached to the sig.


  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16577


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 10, 2023, 10:06:27 AM
Merited by JayJuanGee (1)
 #14

Would self-hosting an API (or something) that managed my signature be frowned upon?
I won't frown on this.

Quote
For example, having a price ticker scape BTC price and update it in text/BB format every 30 mins via tapermonkey or something like that to my signature destination.
This would be very cool as your personal text.

Quote
I could see it potentially causing confusion in archives and stuff,
You're in my signature archive, last checked 15 hours ago. There's a random delay in checking, but on average it should be at least once every 24 hours. If you change your signature a lot, you'll just get a large archive. That's okay. You shouldn't stop doing thing because it might mess up other people's archives.

Quote
or just being annoying if a color changed or something every 30 mins even if I'm not posting.
It's not as if it's blinking, it's still just static data after a page load. What may change though, is your recognition. I felt like I earned much less Merit for a while after I removed CM's signature, so I think the signature helped me to highlight my posts. But I never really checked the data.



You could also rotate your avatar a few degrees, just to mess with people Tongue

unless LoyceV would do their secondary mobile acc for ex.
Ain't gonna happen Smiley

ninjastic would see how many times that snippet was posted for that user and automatically detect if the signature was equipped on post and how many times a post made with that code attached to the sig.
But Ninjastic won't see how many times older posts with the same signature were loaded.

TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6973



View Profile WWW
December 10, 2023, 11:56:42 PM
Merited by JayJuanGee (1), WhyFhy (1)
 #15

I'm making an unnoficial API in Typescript that I'll start using on some of my projects. Here is the snippet for the profile editing I coded today (in case it helps you somehow):

Code:
public async sesc(): Promise<string> {
  this.requireAuthenticated();
  const response = await this.api.get(
    "https://bitcointalk.org/index.php?action=profile",
  );
  const $ = cheerio.load(await response.text());
  const logoutUrl = $(
    'td.maintab_back a[href*="index.php?action=logout;sesc="]',
  ).attr("href");
  const sesc = logoutUrl?.match(/sesc=(.*)/);
  if (sesc && sesc[1]) {
    return sesc[1];
  }
  throw new Error("Could not get sesc");
}

public async getProfile(userId?: ProfileUserId): Promise<Profile> {
  if (!userId) {
    this.requireAuthenticated();
  }

  const url = userId
    ? `https://bitcointalk.org/index.php?action=profile;u=${userId}`
    : "https://bitcointalk.org/index.php?action=profile";

  const response = await this.api.get(url);
  const html = await response.text();
  const $ = cheerio.load(html);

  const name = getTableRowValue($, "Name:");
  const posts = getTableRowValue($, "Posts:");
  const activity = getTableRowValue($, "Activity:");
  const merit = getTableRowValue($, "Merit:");
  const position = getTableRowValue($, "Position:");

  const profileUserId = $("a[href*=/index.php?action=merit;u=]").attr("href")
    ?.match(
      /\/index\.php\?action=merit;u=(\d+)/,
    )?.at(1);

  return {
    name,
    userId: Number(profileUserId),
    posts: Number(posts),
    activity: Number(activity),
    merit: Number(merit),
    position,
  };
}
 
  public async getProfileSettings() {
    this.requireAuthenticated();

    const response = await this.api.get(
      `https://bitcointalk.org/index.php?action=profile;sa=forumProfile`,
    );

    const html = await response.text();
    const $ = cheerio.load(html);

    const personalText = $(
      "#creator > table input[name=personalText]",
    ).attr("value")!;

    const birthYear = $("#creator > table input[name=bday3]").attr("value")!;
    const birthMonth = $("#creator > table input[name=bday1]").attr("value")!;
    const birthDay = $("#creator > table input[name=bday2]").attr("value")!;
    const location = $("#creator > table input[name=location]").attr("value")!;

    const gender = $([
      ...$(
        "#creator > table select[name=gender] > option",
      ),
    ].find((option) => $(option).attr("selected"))).attr("value") ?? 0;

    const ICQ = $("#creator > table input[name=ICQ]").attr("value")!;
    const AIM = $("#creator > table input[name=AIM]").attr("value")!;
    const MSN = $("#creator > table input[name=MSN]").attr("value")!;
    const YIM = $("#creator > table input[name=YIM]").attr("value")!;
    const signature = $("#creator > table textarea[name=signature]").text();
    const websiteTitle = $("#creator > table input[name=websiteTitle]").attr(
      "value",
    )!;
    const websiteUrl = $("#creator > table input[name=websiteUrl]").attr(
      "value",
    )!;
    const skype = $("#creator > table input[name='default_options[CP1]']").attr(
      "value",
    )!;
    const bitcoinAddress = $(
      "#creator > table input[namr='default_options[addr]']",
    ).attr("value")!;
    const otherContactInfo = $(
      $("#creator > table input[name='default_options[CP11]']"),
    ).attr("value")!;

    const showUntrustedFeedbackByDefault =
      $("#creator > table input.check[name='default_options[show_untrusted]']")
        .attr("checked") === "checked";
    const showPatrolLink =
      $("#creator > table input.check[name='default_options[showpatrol]']")
        .attr("checked") === "checked";

    const showPostCountByPosts =
      $("#creator > table input.check[name='default_options[showpostcount]']")
        .attr("checked") === "checked";

    const disableAds =
      $("#creator > table input.check[name='default_options[noads]']").attr(
        "checked",
      ) === "checked";

    const result = {
      personalText,
      birthYear: String(birthYear),
      birthMonth: String(birthMonth),
      birthDay: String(birthDay),
      location,
      gender: Number(gender),
      ICQ,
      AIM,
      MSN,
      YIM,
      signature,
      websiteTitle,
      websiteUrl,
      skype,
      bitcoinAddress,
      otherContactInfo,
      showUntrustedFeedbackByDefault,
      showPatrolLink,
      showPostCountByPosts,
      disableAds,
    };

    return result;
  }

  public async editProfile(data?: EditProfileData): Promise<boolean> {
    const currentSettings = await this.getProfileSettings();
    const profile = await this.getProfile();
    const sesc = await this.sesc();

    const body = new FormData();

    const fields: Record<string, string | number> = {
      personalText: data?.personalText ?? currentSettings.personalText,
      bday3: String(currentSettings.birthYear),
      bday2: String(currentSettings.birthDay),
      bday1: String(currentSettings.birthMonth),
      location: data?.location ?? currentSettings.location,
      gender: currentSettings.gender,
      ICQ: currentSettings.ICQ,
      AIM: currentSettings.AIM,
      MSN: currentSettings.MSN,
      YIM: currentSettings.YIM,
      signature: data?.signature ?? currentSettings.signature,
      websiteTitle: data?.websiteTitle ?? currentSettings.websiteTitle,
      websiteUrl: data?.websiteTitle ?? currentSettings.websiteUrl,
      "default_options[CP1]": currentSettings.skype,
      "default_options[addr]": data?.bitcoinAddress ??
        currentSettings.bitcoinAddress,
      "default_options[show_untrusted]": Number(
        currentSettings.showUntrustedFeedbackByDefault,
      ),
      "default_options[showpatrol]": Number(currentSettings.showPatrolLink),
      "default_options[showpostcount]": Number(
        currentSettings.showPostCountByPosts,
      ),
      "default_options[CP11]": currentSettings.otherContactInfo,
      "default_options[noads]": Number(currentSettings.disableAds),
      sc: sesc,
      userID: profile.userId,
      sa: "forumProfile",
    };

    for (const field in fields) {
      body.set(field, String(fields[field]));
    }

    await this.api.post(
      "https://bitcointalk.org/index.php?action=profile2",
      {
        body,
      },
    );

    return true;
  }

Code:
const forum = new BitcoinTalkApi();
await forum.auth({
  username: "TryNinja_BOT2",
  password: "xxxxxxxxxx",
  captchaCode: "xxxxxxxxx",
});

await forum.editProfile({ signature: "my signature bbcode here!" });

Some stuff is missing because it's WIP, but you can still have an idea of how it works.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 11, 2023, 02:35:53 AM
 #16

I'm making an unnoficial API in Typescript that I'll start using on some of my projects. Here is the snippet for the profile editing I coded today (in case it helps you somehow):

Code:
public async sesc(): Promise<string> {
  this.requireAuthenticated();
  const response = await this.api.get(
    "https://bitcointalk.org/index.php?action=profile",
  );
  const $ = cheerio.load(await response.text());
  const logoutUrl = $(
    'td.maintab_back a[href*="index.php?action=logout;sesc="]',
  ).attr("href");
  const sesc = logoutUrl?.match(/sesc=(.*)/);
  if (sesc && sesc[1]) {
    return sesc[1];
  }
  throw new Error("Could not get sesc");
}

public async getProfile(userId?: ProfileUserId): Promise<Profile> {
  if (!userId) {
    this.requireAuthenticated();
  }

  const url = userId
    ? `https://bitcointalk.org/index.php?action=profile;u=${userId}`
    : "https://bitcointalk.org/index.php?action=profile";

  const response = await this.api.get(url);
  const html = await response.text();
  const $ = cheerio.load(html);

  const name = getTableRowValue($, "Name:");
  const posts = getTableRowValue($, "Posts:");
  const activity = getTableRowValue($, "Activity:");
  const merit = getTableRowValue($, "Merit:");
  const position = getTableRowValue($, "Position:");

  const profileUserId = $("a[href*=/index.php?action=merit;u=]").attr("href")
    ?.match(
      /\/index\.php\?action=merit;u=(\d+)/,
    )?.at(1);

  return {
    name,
    userId: Number(profileUserId),
    posts: Number(posts),
    activity: Number(activity),
    merit: Number(merit),
    position,
  };
}
 
  public async getProfileSettings() {
    this.requireAuthenticated();

    const response = await this.api.get(
      `https://bitcointalk.org/index.php?action=profile;sa=forumProfile`,
    );

    const html = await response.text();
    const $ = cheerio.load(html);

    const personalText = $(
      "#creator > table input[name=personalText]",
    ).attr("value")!;

    const birthYear = $("#creator > table input[name=bday3]").attr("value")!;
    const birthMonth = $("#creator > table input[name=bday1]").attr("value")!;
    const birthDay = $("#creator > table input[name=bday2]").attr("value")!;
    const location = $("#creator > table input[name=location]").attr("value")!;

    const gender = $([
      ...$(
        "#creator > table select[name=gender] > option",
      ),
    ].find((option) => $(option).attr("selected"))).attr("value") ?? 0;

    const ICQ = $("#creator > table input[name=ICQ]").attr("value")!;
    const AIM = $("#creator > table input[name=AIM]").attr("value")!;
    const MSN = $("#creator > table input[name=MSN]").attr("value")!;
    const YIM = $("#creator > table input[name=YIM]").attr("value")!;
    const signature = $("#creator > table textarea[name=signature]").text();
    const websiteTitle = $("#creator > table input[name=websiteTitle]").attr(
      "value",
    )!;
    const websiteUrl = $("#creator > table input[name=websiteUrl]").attr(
      "value",
    )!;
    const skype = $("#creator > table input[name='default_options[CP1]']").attr(
      "value",
    )!;
    const bitcoinAddress = $(
      "#creator > table input[namr='default_options[addr]']",
    ).attr("value")!;
    const otherContactInfo = $(
      $("#creator > table input[name='default_options[CP11]']"),
    ).attr("value")!;

    const showUntrustedFeedbackByDefault =
      $("#creator > table input.check[name='default_options[show_untrusted]']")
        .attr("checked") === "checked";
    const showPatrolLink =
      $("#creator > table input.check[name='default_options[showpatrol]']")
        .attr("checked") === "checked";

    const showPostCountByPosts =
      $("#creator > table input.check[name='default_options[showpostcount]']")
        .attr("checked") === "checked";

    const disableAds =
      $("#creator > table input.check[name='default_options[noads]']").attr(
        "checked",
      ) === "checked";

    const result = {
      personalText,
      birthYear: String(birthYear),
      birthMonth: String(birthMonth),
      birthDay: String(birthDay),
      location,
      gender: Number(gender),
      ICQ,
      AIM,
      MSN,
      YIM,
      signature,
      websiteTitle,
      websiteUrl,
      skype,
      bitcoinAddress,
      otherContactInfo,
      showUntrustedFeedbackByDefault,
      showPatrolLink,
      showPostCountByPosts,
      disableAds,
    };

    return result;
  }

  public async editProfile(data?: EditProfileData): Promise<boolean> {
    const currentSettings = await this.getProfileSettings();
    const profile = await this.getProfile();
    const sesc = await this.sesc();

    const body = new FormData();

    const fields: Record<string, string | number> = {
      personalText: data?.personalText ?? currentSettings.personalText,
      bday3: String(currentSettings.birthYear),
      bday2: String(currentSettings.birthDay),
      bday1: String(currentSettings.birthMonth),
      location: data?.location ?? currentSettings.location,
      gender: currentSettings.gender,
      ICQ: currentSettings.ICQ,
      AIM: currentSettings.AIM,
      MSN: currentSettings.MSN,
      YIM: currentSettings.YIM,
      signature: data?.signature ?? currentSettings.signature,
      websiteTitle: data?.websiteTitle ?? currentSettings.websiteTitle,
      websiteUrl: data?.websiteTitle ?? currentSettings.websiteUrl,
      "default_options[CP1]": currentSettings.skype,
      "default_options[addr]": data?.bitcoinAddress ??
        currentSettings.bitcoinAddress,
      "default_options[show_untrusted]": Number(
        currentSettings.showUntrustedFeedbackByDefault,
      ),
      "default_options[showpatrol]": Number(currentSettings.showPatrolLink),
      "default_options[showpostcount]": Number(
        currentSettings.showPostCountByPosts,
      ),
      "default_options[CP11]": currentSettings.otherContactInfo,
      "default_options[noads]": Number(currentSettings.disableAds),
      sc: sesc,
      userID: profile.userId,
      sa: "forumProfile",
    };

    for (const field in fields) {
      body.set(field, String(fields[field]));
    }

    await this.api.post(
      "https://bitcointalk.org/index.php?action=profile2",
      {
        body,
      },
    );

    return true;
  }

Code:
const forum = new BitcoinTalkApi();
await forum.auth({
  username: "TryNinja_BOT2",
  password: "xxxxxxxxxx",
  captchaCode: "xxxxxxxxx",
});

await forum.editProfile({ signature: "my signature bbcode here!" });

Some stuff is missing because it's WIP, but you can still have an idea of how it works.

awesome, I'll see what I can contribute sometime this week, how you ever seen mturk? This give me more ideas like the feedback system they had via scripts.

  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6973



View Profile WWW
December 11, 2023, 03:20:41 AM
 #17

how you ever seen mturk? This give me more ideas like the feedback system they had via scripts.
I have no idea what that is, to be honest. Cheesy

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
WhyFhy (OP)
Hero Member
*****
Offline Offline

Activity: 1430
Merit: 513



View Profile
December 28, 2023, 06:27:40 AM
Merited by JayJuanGee (1)
 #18

Mturk was a platform for micro earnings offered by Amazon, it was kinda like microlancer , but you would do stuff like validate receipts , test/enter captcha, Identify pictures, train bots ,surveys all kinds of stuff  you had tm/greasyfork scripts  with lots of downloads that basically acted as a 3rd party vetting system about the vendors offering the jobs once enough people used it. It also had convince scripts built in.
I can't believe nothing like this has been made for Bitcointalk tbh (to be fair I couldn't belive a scripted secondary platform like this existed for a site that generally paid pocket change for task, it was Amazon though.), we could do something like it right ? have wallets used under profile , signatures posted
Script blocking. Payment request,hot key post inserts like payment request. Merit to post ratio. Lots of useless uses but cool! The mturk script had features like a good rated vendor posting a high paying job would initiate a chime/notification, maybe something could be made on bct without login data needed.

I went down a new rabbit hole playing with CF pages/workers.
I'm impressed and can't believe I missed this. Based on what I see these can host simple website and apps free,possibly forever?
Worker routing has my interest in particular. Idk I'm still messing with this stuff scoping it out. Maybe a system could be built on it and really be set and forget.
https://developers.cloudflare.com/workers/
https://developers.cloudflare.com/pages/

Potential for a whole layer 2 of Bitcointalk.org user experience. not just signatures. Just thinking out loud.





  BTC
.
BTC
.
 BTC
.
BTC
/]..[banned mixer]..
██
██
██
██
██
██
██

██

██

██

██
/]YOUR OPPORTUNITY TO
HAVE BITCOIN BUSINESS

██
██
██
██
██
██
██

██

██

██

██
.
  BTC
. BTC
.
.
 
BTC
  BTC
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6715


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 28, 2023, 06:51:33 AM
Merited by JayJuanGee (1)
 #19

I think it would be fine, as long as it is not making too many requests per second, but since you're essentially running this once every 30 minutes, there's nothing to worry about.

The bigger problem is how are you going to do this properly when there is no forum API, and you need to rely on cookies and browser sessions and generally just getting it to work in the first place.

how you ever seen mturk? This give me more ideas like the feedback system they had via scripts.
I have no idea what that is, to be honest. Cheesy

Mturk is basically like paying sweatshop workers to make an iPhone or a pair of Nike sneakers except with online work.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!