Bitcoin Forum
April 26, 2024, 03:32:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2] 3 »  All
  Print  
Author Topic: [BRAINSTORM] Any requests for custom extensions/user scripts for BitcoinTalk?  (Read 1283 times)
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16550


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 22, 2019, 04:23:22 AM
 #21

The main problem is probably getting the merit data. You would need to make your own scraper to get merit data and then build an API or maybe ask Vod or Loyce for an API.
I have no plans on making an API (and have no idea how to do this). Besides, I don't scrape Merit continuously, only weekly (full list: merit.all.txt).

API probably is best solution, but i was thinking about parsing HTML from user's merit summary page & built a list/dictionary contains total merit sent & count of merit transaction to an user.
Instead of scraping individual user's merit summaries, it's much less work to just scrape Recent merits and keep track (that's what BPIP does).

I think Piggy updated it to where it does actually support PMs.
Correct. Maggiordome was polluting the list of unread posts too much.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Initscri (OP)
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
June 22, 2019, 04:27:42 AM
 #22

The main problem is probably getting the merit data. You would need to make your own scraper to get merit data and then build an API or maybe ask Vod or Loyce for an API.
I have no plans on making an API (and have no idea how to do this). Besides, I don't scrape Merit continuously, only weekly (full list: merit.all.txt).

I'm assuming he's just talking about producing an API endpoint. Sort of, a URL which supports a GET request and returns a valid format (JSON). No library needed.

Pretty much what you have here (http://loyce.club/Merit/merit.all.txt), just converted to a JSON format w/ the ability to filter based off parameters (sending user, receiving user, etc)

It could be done w/ 1 front-facing PHP script.

For example,
http://loyce.club/Merit/merit.all.php?sending_user=2458002

@TryNinja, I'm not sure but I recall that Vod may have mentioned about an API in the past. So I'm not sure if one is in development right now.
Could have been me asking about it tho, so not 100% certain.

----------------------------------
Web Developer. PM for details.
----------------------------------
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16550


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 22, 2019, 05:59:15 AM
 #23

I'm assuming he's just talking about producing an API endpoint. Sort of, a URL which supports a GET request and returns a valid format (JSON). No library needed.

Pretty much what you have here (http://loyce.club/Merit/merit.all.txt), just converted to a JSON format w/ the ability to filter based off parameters (sending user, receiving user, etc)

It could be done w/ 1 front-facing PHP script.
I don't know JSON/PHP (and don't really have the time to learn it now), so it's not something I can easily produce. But if someone (you?) wants to create it based on the full Merit data, go ahead. I can create for instance api.loyce.club to host it. Just tell me what I need to do Tongue

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 08:29:19 AM
Last edit: June 22, 2019, 09:00:10 AM by CryptoNeed
 #24

I'm assuming he's just talking about producing an API endpoint. Sort of, a URL which supports a GET request and returns a valid format (JSON). No library needed.

Pretty much what you have here (http://loyce.club/Merit/merit.all.txt), just converted to a JSON format w/ the ability to filter based off parameters (sending user, receiving user, etc)

It could be done w/ 1 front-facing PHP script.
I don't know JSON/PHP (and don't really have the time to learn it now), so it's not something I can easily produce. But if someone (you?) wants to create it based on the full Merit data, go ahead. I can create for instance api.loyce.club to host it. Just tell me what I need to do Tongue

Has been a while since I did PHP but I hope this helps:

Quote
<?php
header("Content-type:application/json");

//dtg, merit, msg, giver, receiver
$url = "merits.txt";
$file = file($url);
$file = str_replace("   ", ",",$file);
$file = str_replace("\r\n", "",$file);
$jsonObj = array();
foreach ($file as $line => $value) {
   $value = explode(",", $value);
   // unsorted (line numbers)
   //$file[$line] = array("DTG" => $value[0], "Merit" => $value[1], "Message" => $value[2], "Donor" => $value[3], "Receiver" => $value[4]);

   //array sorted by DTG
   $jsonObj[]= array($value[0] => array("Merit" => $value[1], "Message" => $value[2], "Donor" => $value[3], "Receiver" => $value[4]));
}
echo json_encode($jsonObj, JSON_PRETTY_PRINT);

?>




Seems to work, could be improved for sure. But otherwise ... it has been a while. Besides this and as already stated, it would be much faster to send individual request to the database (e.g. by GET).
If you tell us the structure of the database, it is actually super easy to implement.

I have forgotten my actual request for this topic ...  Roll Eyes Grin

Got it again:
Sometimes quoting a full text makes posts less well structured. While there is a function to full-quote other posts, I would like to have a function to mark and insert text you actually want to quote from other posts.

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16550


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 22, 2019, 09:04:25 AM
 #25

Seems to work, could be improved for sure.
I think you're overestimating my php-knowledge: I have no idea what to do with this Tongue

Quote
it would be much faster to send individual request to the database (e.g. by GET).
If you tell us the structure of the database, it is actually super easy to implement.
I don't have a database, just static HTML. That makes it very fast to browse as the server just has to read the file from disk, but I'm also at the point that adding more functionality becomes exceedingly difficult. I know nothing about databases and php Sad

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 09:12:07 AM
 #26

Seems to work, could be improved for sure.
I think you're overestimating my php-knowledge: I have no idea what to do with this Tongue

Quote
it would be much faster to send individual request to the database (e.g. by GET).
If you tell us the structure of the database, it is actually super easy to implement.
I don't have a database, just static HTML. That makes it very fast to browse as the server just has to read the file from disk, but I'm also at the point that adding more functionality becomes exceedingly difficult. I know nothing about databases and php Sad

Np, I will write an example script based on your .txt.
Database details for such functionalities would have to be provided by btct admin anyways.

Will adjust the script now ...

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 12:14:22 PM
Last edit: June 22, 2019, 12:33:04 PM by CryptoNeed
Merited by LoyceV (8), suchmoon (4), TryNinja (4), Halab (2), o_e_l_e_o (1), TheBeardedBaby (1)
 #27

Seems to work, could be improved for sure.
I think you're overestimating my php-knowledge: I have no idea what to do with this Tongue

Quote
it would be much faster to send individual request to the database (e.g. by GET).
If you tell us the structure of the database, it is actually super easy to implement.
I don't have a database, just static HTML. That makes it very fast to browse as the server just has to read the file from disk, but I'm also at the point that adding more functionality becomes exceedingly difficult. I know nothing about databases and php Sad

Np, I will write an example script based on your .txt.
Database details for such functionalities would have to be provided by btct admin anyways.

Will adjust the script now ...

Output in HTML:

Quote

<?php
//GET Request by: merithtml.php?donor=USERID

$url = "http://loyce.club/Merit/merit.all.txt";
$file = file($url);
$file = str_replace("   ", ",",$file);
$file = str_replace("\r\n", "",$file);
// put the array together
foreach ($file as $line => $value) {
   $value = explode(",", $value);
    $bigArray[] = array("Donor" => $value[3], "Recipient" => $value[4], "Merits" => $value[1], "Msg" => $value[2], "DTG" => $value[0]);
}

function searchForDonor($uid, $array) {
   echo "<table>";
   foreach ($array as $key => $val) {
      if($val["Donor"] === $uid) {
         //print_r($array[$key]);
         echo "<tr>
               <td>".date("d.m.Y H:i:s", $val["DTG"])."</td>
               <td><a href='https://bitcointalk.org/index.php?topic=".$val["Msg"]."#". strstr($val["Msg"], "msg")."'>".$val["Msg"]."</a></td>
               <td><a href='https://bitcointalk.org/index.php?action=profile;u=".$val["Donor"]."'>".$val["Donor"]."</a></td>
               <td>-(".$val["Merits"].")-></td>
               <td><a href='https://bitcointalk.org/index.php?action=profile;u=".$val["Recipient"]."'>".$val["Recipient"]."</a></td>
            </tr>";
      }
   }
   return null;
   echo "</table>";
}

function searchForRecipient($uid, $array) {
   echo "<table>";
   foreach ($array as $key => $val) {
      if($val["Recipient"] === $uid) {
         //print_r($array[$key]);
         echo "<tr>
               <td>".date("d.m.Y H:i:s", $val["DTG"])."</td>
               <td><a href='https://bitcointalk.org/index.php?topic=".$val["Msg"]."#". strstr($val["Msg"], "msg")."'>".$val["Msg"]."</a></td>
               <td><a href='https://bitcointalk.org/index.php?action=profile;u=".$val["Recipient"]."'>".$val["Recipient"]."</a></td>
               <td><-(".$val["Merits"].")-</td>
               <td><a href='https://bitcointalk.org/index.php?action=profile;u=".$val["Donor"]."'>".$val["Donor"]."</a></td>
            </tr>";
      }
   }
   return null;
   echo "</table>";
}

if(isset($_GET["donor"])) {
   searchForDonor($_GET["donor"], $bigArray);
}

if(isset($_GET["recipient"])) {
   searchForRecipient($_GET["recipient"], $bigArray);
}

?>


Output as JSON array:

Quote

<?php
//GET Request by: meritjson.php?donor=USERID
header('Content-Type: application/json');
$url = "http://loyce.club/Merit/merit.all.txt";
$file = file($url);
$file = str_replace("   ", ",",$file);
$file = str_replace("\r\n", "",$file);
// put the array together
foreach ($file as $line => $value) {
   $value = explode(",", $value);
    $bigArray[] = array("Donor" => $value[3], "Recipient" => $value[4], "Merits" => $value[1], "Msg" => $value[2], "DTG" => $value[0]);
}

function searchForDonor($uid, $array) {
   foreach ($array as $key => $val) {
      if($val["Donor"] === $uid) {
         echo json_encode($array[$key], JSON_PRETTY_PRINT);
      }
   }
   return null;
}

function searchForRecipient($uid, $array) {
   foreach ($array as $key => $val) {
      if($val["Recipient"] === $uid) {
         echo json_encode($array[$key], JSON_PRETTY_PRINT);
      }
   }
   return null;
}

if(isset($_GET["donor"])) {
   searchForDonor($_GET["donor"], $bigArray);
}

if(isset($_GET["recipient"])) {
   searchForRecipient($_GET["recipient"], $bigArray);
}


?>


Once uploaded, you can search your .txt for merits given and received by users through file.php?donor=USERID and ?recipient=USERID
Hope it fits the needs.  Smiley

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16550


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 22, 2019, 12:16:34 PM
 #28

Hope it fits the needs.  Smiley
Is this something I run on the server?
(complete n00b here)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 12:19:35 PM
 #29

Hope it fits the needs.  Smiley
Is this something I run on the server?
(complete n00b here)

yes.

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
TryNinja
Legendary
*
Offline Offline

Activity: 2814
Merit: 6971



View Profile WWW
June 22, 2019, 12:24:09 PM
Last edit: June 22, 2019, 12:41:25 PM by TryNinja
 #30

Hope it fits the needs.  Smiley
Is this something I run on the server?
(complete n00b here)
Call this file anything-you-want.php and just upload it in the same folder as the merit.all.txt file.

But if you don’t want, I could try making my own as well. I thought I had to scrape each user merit page or similar.

Edit:@Loyce how do you get the name of the users and posts?

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

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

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

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

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

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











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











▄▄▄▄█
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 12:32:19 PM
 #31

Hope it fits the needs.  Smiley
Is this something I run on the server?
(complete n00b here)
Call this file anything-you-want.php and just upload it in the same folder there is the merit.all.txt file.

But if you don’t want, I could try making my own as well. I thought I had to scrape each user merit page or similar.

Exactly. Sorry, I forgot to mention it. I made two files.
The HTML-Output file will generate clickable links for everyone and the other file will provide other users with a "light API" for your file.
If you safe these files in the same directory on your server where the merit.all.txt is located, you can set $url to "merit.all.txt". If not, you may need to adjust the variable.

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16550


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
June 22, 2019, 05:57:55 PM
 #32

@CryptoNeed: I haven't had the time to thoroughly look at it, but thanks for the code!

Call this file anything-you-want.php and just upload it in the same folder as the merit.all.txt file.

But if you don’t want, I could try making my own as well. I thought I had to scrape each user merit page or similar.

Edit:@Loyce how do you get the name of the users and posts?
I'll have time for it tomorrow. I'll also make a new topic tomorrow (something like: "loyce.club crowdsourced user scripts"), because (although very interesting) I think we're a bit off-topic here.

All my public Merit data is summarized in this post, including usernames. Post titles are published in a 98 MB large file, I can make a less bloated version if needed.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Initscri (OP)
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
June 22, 2019, 06:57:28 PM
Merited by LoyceV (2)
 #33

~snip

Good job man! You're fast.

What system/PHP version are you running?

I tried running on my local system. When you pull merit.all.txt, is it showing spaces for you, or tabs? For me, locally, it's showing tabs, so the top had to be changed to the following.

Code:
$url = "http://loyce.club/Merit/merit.all.txt"; 
$file = file($url);
$file = str_replace("\t", ",", $file);
$file = str_replace("\r\n", "",$file);

I'm not sure why there's a difference, perhaps it's environmental. But, I'd maybe switch to a regex to permit both spaces/tabs just in case.

Also, the return null; within the functions aren't allowing the table to be finished semantically (no </table>), so I'd drop those, or move the echo up.

Code:
echo "</table>";
return null;

For todos, it's probably a good idea to accept no parameters as well, combining the script to allow the user to specify a output method (JSON, or table format)

I can help out providing modifications to your code, but I wanna grab your permission first. Your code after all.

Good job though, and thanks!

----------------------------------
Web Developer. PM for details.
----------------------------------
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 10:42:51 PM
 #34

~snip

Good job man! You're fast.

What system/PHP version are you running?

I tried running on my local system. When you pull merit.all.txt, is it showing spaces for you, or tabs? For me, locally, it's showing tabs, so the top had to be changed to the following.

Code:
$url = "http://loyce.club/Merit/merit.all.txt"; 
$file = file($url);
$file = str_replace("\t", ",", $file);
$file = str_replace("\r\n", "",$file);

I'm not sure why there's a difference, perhaps it's environmental. But, I'd maybe switch to a regex to permit both spaces/tabs just in case.

Also, the return null; within the functions aren't allowing the table to be finished semantically (no </table>), so I'd drop those, or move the echo up.

Code:
echo "</table>";
return null;

For todos, it's probably a good idea to accept no parameters as well, combining the script to allow the user to specify a output method (JSON, or table format)

I can help out providing modifications to your code, but I wanna grab your permission first. Your code after all.

Good job though, and thanks!

Hi, thanks for you inputs.
As I said: It's been a while since I actively coded a lot. Grin
Of course you can use and modify this code. Feel free.

For me it is tabs aswell, but it works like a charme (win xamp v3.2.2. w/ std ini's).
regex are far better! I am just suffering from forgotten knowledge and lazyness. (see above: it has been a while Grin)

Return and Echo is obv incorrect and has to be changed.
Parameters: I was not sure what was exactly needed. So I made just two versions. But afterall a good idea to just add another bool for JSON output or not, or something like this. Also I initially wanted to work with switch() and parse the whole array as a default.

Holy grail would be a read-only database access to the effected tables. Would be much faster and easier.

Cheers!

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
Initscri (OP)
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
June 22, 2019, 10:48:27 PM
 #35

~snip

Good job man! You're fast.

What system/PHP version are you running?

I tried running on my local system. When you pull merit.all.txt, is it showing spaces for you, or tabs? For me, locally, it's showing tabs, so the top had to be changed to the following.

Code:
$url = "http://loyce.club/Merit/merit.all.txt"; 
$file = file($url);
$file = str_replace("\t", ",", $file);
$file = str_replace("\r\n", "",$file);

I'm not sure why there's a difference, perhaps it's environmental. But, I'd maybe switch to a regex to permit both spaces/tabs just in case.

Also, the return null; within the functions aren't allowing the table to be finished semantically (no </table>), so I'd drop those, or move the echo up.

Code:
echo "</table>";
return null;

For todos, it's probably a good idea to accept no parameters as well, combining the script to allow the user to specify a output method (JSON, or table format)

I can help out providing modifications to your code, but I wanna grab your permission first. Your code after all.

Good job though, and thanks!

Hi, thanks for you inputs.
As I said: It's been a while since I actively coded a lot. Grin
Of course you can use and modify this code. Feel free.

For me it is tabs aswell, but it works like a charme (win xamp v3.2.2. w/ std ini's).
regex are far better! I am just suffering from forgotten knowledge and lazyness. (see above: it has been a while Grin)

Return and Echo is obv incorrect and has to be changed.
Parameters: I was not sure what was exactly needed. So I made just two versions. But afterall a good idea to just add another bool for JSON output or not, or something like this. Also I initially wanted to work with switch() and parse the whole array as a default.

Holy grail would be a read-only database access to the effected tables. Would be much faster and easier.

Cheers!

No worries man. Yea, I think there's a difference of interpretation between Windows versions of PHP & Linux, which may be why. I'm running on Mac right now.

I'll make a combined version tonight/tomorrow, and switch it to a regex just in case.

----------------------------------
Web Developer. PM for details.
----------------------------------
CryptoNeed
Full Member
***
Offline Offline

Activity: 504
Merit: 137


Nope.


View Profile WWW
June 22, 2019, 10:50:52 PM
 #36

No worries man. Yea, I think there's a difference of interpretation between Windows versions of PHP & Linux, which may be why. I'm running on Mac right now.

I'll make a combined version tonight/tomorrow, and switch it to a regex just in case.

Thx, please share afterwards. Smiley
I gonna run the old code on my Mac later/tomorrow. I'm curious. Grin

Great minds discuss ideas,
average minds discuss events,
small minds discuss people. (Eleanor Roosevelt)
Initscri (OP)
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
June 22, 2019, 10:52:07 PM
 #37

No worries man. Yea, I think there's a difference of interpretation between Windows versions of PHP & Linux, which may be why. I'm running on Mac right now.

I'll make a combined version tonight/tomorrow, and switch it to a regex just in case.

Thx, please share afterwards. Smiley
I gonna run the old code on my Mac later/tomorrow. I'm curious. Grin

Could just be my machine lol. I'll let you know Smiley

----------------------------------
Web Developer. PM for details.
----------------------------------
DarkDays
Legendary
*
Offline Offline

Activity: 2030
Merit: 1189


View Profile
June 22, 2019, 11:32:45 PM
 #38

Would also be nice to have a script that automatically bumps a thread every 24 hours, ideally deleting the previous bump so as not to spam up the thread.

If this could be combined with custom texts that are randomly cycled that would be even better.

If something like this already exists, please do let me know as I play to launch a service thread soon and this would be very useful (+5 merits for the link!)
Initscri (OP)
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 759


View Profile WWW
June 23, 2019, 12:10:40 AM
Last edit: June 23, 2019, 12:33:43 AM by Initscri
 #39

Would also be nice to have a script that automatically bumps a thread every 24 hours, ideally deleting the previous bump so as not to spam up the thread.

If this could be combined with custom texts that are randomly cycled that would be even better.

If something like this already exists, please do let me know as I play to launch a service thread soon and this would be very useful (+5 merits for the link!)

At the very least this would have to be an extension, and not sure how easy this would be, or if it's even possible within the scopes of a browser extension.

Would probably have to be something server side.

----------------------------------
Web Developer. PM for details.
----------------------------------
Quickseller
Copper Member
Legendary
*
Offline Offline

Activity: 2870
Merit: 2298


View Profile
June 23, 2019, 12:20:17 AM
Merited by DarkDays (5)
 #40

Would also be nice to have a script that automatically bumps a thread every 24 hours, ideally deleting the previous bump so as not to spam up the thread.

If this could be combined with custom texts that are randomly cycled that would be even better.

If something like this already exists, please do let me know as I play to launch a service thread soon and this would be very useful (+5 merits for the link!)
https://github.com/buxlover/autobump

I didn't create this personally, nor have I inspected it.

People have sold similar bots in the past, and even tried to use this as a service.
Pages: « 1 [2] 3 »  All
  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!