Forum Settings
Forums

saka's minimal signature script (with merged anime/manga feeds)

New
Reply Disabled for Non-Club Members
Pages (9) « First ... « 7 8 [9]
Feb 1, 2014 10:18 AM
Offline
May 2012
243
@saka, I don't know, why this script not running correctly on my server.

I downloaded the package, I uploaded it to my server, I set chmod to 777 for the cache directory, I changed username and disabled check_cache(10), but when I open sig.php then I see only background - without text.

My server details:
linux, php 5.3.28 (but if I want, I can upgrade to 5.4.23)

this is link for my sig.php : http://mal.isvn.pl/liveSig/sig.php

Any ideas?
Feb 1, 2014 12:46 PM

Offline
May 2008
4052
It's being blocked by Incapsula most likely, which is MAL's instrusion detection. I've been testing a fix after requesting a whitelist from Crave, and I'll post a patch today or tomorrow.

I am a banana.
Feb 1, 2014 2:06 PM

Offline
Aug 2011
51
Any progress??? :(
Feb 1, 2014 4:01 PM
Offline
May 2012
243
Oh, so it's not my fault and my server? :)
Well then, I'll wait for patch.
Feb 3, 2014 10:16 PM

Offline
May 2008
4052
Patched it, tested, worked, stopped working, worked, stopped working, worked. I'll keep yelling at Crave.

I am a banana.
Feb 6, 2014 5:19 AM

Offline
Jul 2007
40
saka said:
Patched it, tested, worked, stopped working, worked, stopped working, worked. I'll keep yelling at Crave.

Lol.

Apo is thinking of just downloading the RSS feed manually for the moment and let the script read from that for now.

Feb 8, 2014 5:54 AM
Offline
May 2012
243
@saka, so still not work? :(

Hmm... Maybe...
Where I find signature script only for MAL Updater?
Feb 23, 2014 3:21 PM

Offline
Jul 2007
40
IdolwSzutrab7 said:
@saka, so still not work? :(

Hmm... Maybe...
Where I find signature script only for MAL Updater?


What do you mean by a script for MAL Updater only? Do you mean you want it runnable only by your MALu client?

Feb 27, 2014 6:14 PM

Offline
Jul 2007
40
MAL keeps auto bannign me when I post this msg, so gotta post the outputs in pastebin:

Took another wack at it with java instead, got a little further. If you make it think you are a web browser and actually get through, it will give you a page with only a small javascript redirection script..encrypted of course. Think this might be the last hurdle and then the honey pot might be available. luckily java can now parse javascript syntax..

http://pastebin.com/0eudt43v

which converts to:

http://pastebin.com/3sm9tHMP

Yay for Java, anyone else can take the second wack, Apo's taking a break

Feb 27, 2014 7:56 PM

Offline
May 2008
4052
I actually had tried using the header for Chrome, with my whitelisted user agent, and it did work for a while. I tried eliminating tags until it didn't work again, then it stopped working even with the complete header so I got frustrated and got the urge to write hate mail on crave's facebook page.

I don't think it's right that I should have to pretend I'm a web browser, and the code looks messy as well. Even when I do that though it doesn't seem to work all the time.

I am a banana.
Mar 2, 2014 12:34 AM
Offline
May 2012
243
Apocist said:
IdolwSzutrab7 said:
What do you mean by a script for MAL Updater only? Do you mean you want it runnable only by your MALu client?


In MAL Updater we have plugin "PHP Signature" that sends data by $_GET and must give a link to sig.php.


Btw. @saka, still not work? My link: http://mal.isvn.pl/liveSig/sig.php :(
Mar 4, 2014 6:19 PM

Offline
Jul 2007
40
Well Apo changed to read the manual animelist.xml file.... but it still doesn't retrieve the anime thumbnail for my sig ;.;

Edit1: Well apo adds image manuelly for now them....now...off to mass bulk download all the anime thumbnails for cache
Edit2: Well seeing as it is impossible to completely automate signature due to AreYouHuman checks, PHP seems improbable.

My question to everyone is this: Would you use a lightweight application to generate a dynamic signature for you? (You may be required to input a CAPCHA every/other use)
Edit3: Went ahead and started making it, so far CAPCHAs have never popped up for me and it retrieved anime thumbnails by id and the animeList.xml without fail or interaction.

Next step is making the image processing, it will probably be handled with javascript for simplicity.....

You know... Apo just might make a whole program out of this to allow designing a signature on a canvas in realtime to save a script to process.

Mod edit: merged quadruple post
koleareSep 22, 2014 6:27 AM

Mar 6, 2014 1:43 AM
Offline
May 2012
243
@Apocist, your signature works correctly? What script do you use?
Mar 6, 2014 8:42 AM

Offline
Jul 2007
40
IdolwSzutrab7 said:
@Apocist, your signature works correctly? What script do you use?


The signature you see is working correctly because I manuelly downloaded my history list and the anime thumbnail for saka's script to use(and modified the script a tad).

Apo found another way to retrieve these items though, one which won't require a user to have their server process the script, but instead process the script right from their computer and possibly upload to the server.

Right now Apo is just making a engine to create the said signature

Apr 5, 2014 8:50 AM

Offline
Aug 2011
51
saka said:
I actually had tried using the header for Chrome, with my whitelisted user agent, and it did work for a while. I tried eliminating tags until it didn't work again, then it stopped working even with the complete header so I got frustrated and got the urge to write hate mail on crave's facebook page.

I don't think it's right that I should have to pretend I'm a web browser, and the code looks messy as well. Even when I do that though it doesn't seem to work all the time.


Any progress? :)
Sep 22, 2014 6:46 AM

Offline
Aug 2010
2344
To anyone who doesn't know a PHP (and those who are too lazy to code it :P), I've created a minor, slightly working fix myself.

http://pastebin.com/mbvb3Yav (what needs to be changed is pretty self explanatory)

Note: it doesn't help with the connection to MAL, and from time to time, I saw that it still fails to download your history data. What I did with it is creating a cache for the updates as well, so if the download fails, it will load up the updates' cache.

FAQ:
A: I get an array_multisort warning.
Q: I'm not sure what happened in the meantime, but the history's xml might've changed a bit (haven't checked it back in the time), so now, saka's code which puts the stats into those arrays (ids, timematches, etc.) is not putting the types in the $types array, and the ids in the $ids array. A quick way to fix this is by commenting (putting a double slash: //) the lines:
$types = $linkmatches[1];
$ids = $linkmatches[2];
After, you'll have to edit the array_multisort function too, to look like this:
array_multisort($timestamps,SORT_DESC,$titles,$status,$current,$totals,$units,$subtypes);

Yes, I'm too lazy to fix it myself, so I just cut what was wrong with it :P

Q: I get lots of Index not found errors when loading the script for the first time.
A: That means that the download of your uploads has failed, and because it's the first we loaded the script, there won't be any updates cache either. I've put a recursive call, which/should will be called every 10 seconds while the caches are empty, but I'm not sure how well it works. I recommend refreshing the script until you get it :P

Well, if someone's got a problem, PM me and let's try to fix it together!
And just saying, not sure how well the 'fast' fix will work for everyone, but it works in my current sig, so yeah.
koleareSep 22, 2014 6:51 AM
Sep 22, 2014 7:37 PM

Offline
May 2008
4052
private paste is private

I'd be interested to see where you got with it. I also got it working unreliably.

I am a banana.
Sep 27, 2014 3:36 AM

Offline
Aug 2010
2344
saka said:
private paste is private
Woops, fixed that.
saka said:
I'd be interested to see where you got with it. I also got it working unreliably.
I simply added another if to the download method. If the curl and file_get_contents failed, it will try loading up the updates cache files (which after you managed to download them for the first time, they'll be there). I made them independent from one another, so if downloading fails only for one of them, it will still update the other one. It makes regenerating the sig a bit slower, but it works fine I think.

It can be optimized, but I'm too lazy to think of something for the moment.

LE: It looks like my signature broke yesterday, and I think I found the culprit as well. It looks like crave worked on the rss feeds, which in turn break the $statusmatches array. This is how the downloaded rss feed looks like now: http://puu.sh/bPHbs/1ea81428b0
I'm not sure if they've been there before, but I see the
<link>
and
<guid>
tags now... also, the status is now wrapped in CDATA, which probably breaks the matching. So yeah, it looks like crave is trying to do something...

The quick and dirty fix to it is changing the method which matches the $statusmatches:
koleareSep 30, 2014 12:37 PM
Sep 27, 2014 11:31 AM

Offline
May 2008
4052
I suppose that makes it a bit more robust. Alternatively you can just link to the cache image and then update the script regularly using cron or a program like taiga/malu. Sometimes it will fail to update, but it will at least always display an image. Thing is, incapsula blocks it most of the time. Really it's broken until they make it work -- even when it's whitelisted it doesn't work.

I am a banana.
Mar 15, 2015 12:06 AM

Offline
Apr 2010
1964
Hi ppl!

So, I noticed that the signature updates are kinda working again, but it seems that the "status" part it's not (that upper bar on my sig should have the anime/manga status and stuff)

I don't really know anything about PHP and coding...
So I dropped by to see if any of you guys have any idea on how to make this work.

Thanks ~
Mar 17, 2015 1:47 PM

Offline
May 2008
4052
They (correctly) added CDATA markup around the status field in the recently watched RSS feeds. I've updated the script to reflect that and I'm glad they are allowing feed downloads again.

You can redownload the script from the first page, or simply replace line 57 that parses the status lines with this:

preg_match_all("/<description><\!\[CDATA\[([^\]]*) - ([\d?]+) of ([\d?]+) ([^\]]*)\]\]><\/description>/", $buffer, $statusmatches);

I am a banana.
Mar 19, 2015 12:19 PM

Offline
Apr 2010
1964
Oh, thank you very much!
Oct 2, 2017 1:36 PM

Offline
Jul 2010
2835
saka said:
They (correctly) added CDATA markup around the status field in the recently watched RSS feeds. I've updated the script to reflect that and I'm glad they are allowing feed downloads again.

You can redownload the script from the first page, or simply replace line 57 that parses the status lines with this:

preg_match_all("/<description><![CDATA[([^]]*) - ([d?]+) of ([d?]+) ([^]]*)]]></description>/", $buffer, $statusmatches);

I know it's been a while, but I'm looking for a nice working PHP signature script for my MAL status right now. I couldn't seem to find a good one to use as a base until I found yours here.

I've been fiddling with your (admittedly a bit old now) script and I can't get the text to show up. I can't seem to find where the problem lies. The RSS links still work, so that's not it.

Is there any chance you might update the script so it works again? Or at least give me a pointer as to where the problem might lie? I have a very basic understanding of PHP. My WIP signature can be found here.

Let me know!

Oct 3, 2017 11:30 AM

Offline
May 2008
4052
I'll take a look. Mine stopped displaying updates too so I need to figure out what's up. I've just been lazy as usual. :-P

I am a banana.
Oct 3, 2017 11:39 AM

Offline
May 2008
4052
Onyxthegreat said:
Let me know!

Well that was an easy fix. Apparently when MAL switched to using https instead of just http they made a redirect page to let people know to use the secure url. My old simple script doesn't have logic to parse http error codes so it just tried to look for titles in the redirect page.

tl;dr in the myanimelist anime and manga rss urls near the top of the script change http to https in both lines. I'll update the first post. Thanks.

I am a banana.
Oct 3, 2017 11:46 AM

Offline
Jul 2010
2835
saka said:
Onyxthegreat said:
Let me know!

Well that was an easy fix. Apparently when MAL switched to using https instead of just http they made a redirect page to let people know to use the secure url. My old simple script doesn't have logic to parse http error codes so it just tried to look for titles in the redirect page.

tl;dr in the myanimelist anime and manga rss urls near the top of the script change http to https in both lines. I'll update the first post. Thanks.


You know what? I was just thinking about trying to switch the RSS URLs to https while at work today. Thanks for confirming it!

Looks like the info is correctly being displayed now. I'm gonna fiddle some more with it to make it look good. Thanks again!

Oct 3, 2017 12:11 PM

Offline
May 2008
4052
Onyxthegreat said:
You know what? I was just thinking about trying to switch the RSS URLs to https while at work today. Thanks for confirming it!

Looks like the info is correctly being displayed now. I'm gonna fiddle some more with it to make it look good. Thanks again!


I also changed the file names so the script is "index.php" inside a folder confusingly called "signature.png" because this gets around the security checks the forum uses now. I helped a few people change that but I forgot to actually describe it or change it in the download.

Where do I point my signature?
The full address to your signature script once you upload it will be something like:
http://yourdomain/path/to/your/signature.png/index.php

...and that address will output your signature image directly (updating in real time if the cache time hasn't passed). The folder is confusingly named "signature.png" to satisfy security checks that the MAL forum uses to make certain attacks more difficult. To avoid incurring the wrath of the security gods, just leave the "/index.php" off the end of the address, giving you forum bbcode that looks like:
[img]http://yourdomain/path/to/your/signature.png[/img]


Alternatively, you can link to the saved image, for example...
[img]http://yourdomain/path/to/your/signature.png/cache/sig.png[/img]

...
sakaOct 3, 2017 12:14 PM

I am a banana.
Oct 3, 2017 12:50 PM

Offline
Jul 2010
2835
saka said:
I also changed the file names so the script is "index.php" inside a folder confusingly called "signature.png" because this gets around the security checks the forum uses now. I helped a few people change that but I forgot to actually describe it or change it in the download.

Where do I point my signature?
The full address to your signature script once you upload it will be something like:

...and that address will output your signature image directly (updating in real time if the cache time hasn't passed). The folder is confusingly named "signature.png" to satisfy security checks that the MAL forum uses to make certain attacks more difficult. To avoid incurring the wrath of the security gods, just leave the "/index.php" off the end of the address, giving you forum bbcode that looks like:


Alternatively, you can link to the saved image, for example...

...


Thanks. I'll change the folder and script name when I'm done!

Meanwhile I am trying to achieve this design. See the $current/$totals in the middle there? I can't get it to work. I only get the first one (current).

See the live sig here.

I've tried putting the following in the text draw:
imagettftextalign($sigimage,41,0,12,74,$color,$font2,$current[0],$totals[0],'l');


This doesn't seem to be correct. Should I be editing the $status array instead to achieve what I want?

Thanks!
OnyxthegreatOct 3, 2017 1:07 PM

Oct 3, 2017 3:14 PM

Offline
May 2008
4052
put "{$current[0]}/{$totals[0]}" as the string you want to print, instead of adding another argument which will probably do things you don't expect.

I am a banana.
Oct 3, 2017 9:35 PM

Offline
Jul 2010
2835
Ah yes, the quotes. Thanks.

edit: Aaand the sig is done. Thanks for the help saka.
OnyxthegreatOct 4, 2017 2:56 AM

Oct 5, 2017 2:43 PM

Offline
Jun 2007
1116
Someone asked me if animated gifs were possible with this, and while I vaguely remember saka trying his hands on this many a years back, the current script certainly doesn't allow it, so I made a few modifications.

src code here, in case someone else wants it:
https://gitlab.com/WoodenDoors/MAL-signature-generator
also includes a bit of refactoring for slightly more OOP, psr-4, composer and yeah: animated gifs (takes roughly 2s to regenerate on my vps though...).
Won't run nearly anywhere like the original though. You've been warned.


very early prototype/proof of concept:
Reply Disabled for Non-Club Members
Pages (9) « First ... « 7 8 [9]

More topics from this board

» Scripted Signature Showcase

KHobbits - Jul 9, 2008

23 by KHobbits »»
Oct 21, 2014 6:42 PM

» MAL Signature Designer

Apocist - Mar 11, 2014

10 by Apocist »»
Aug 6, 2014 3:01 PM

» iSignature

i906 - Dec 11, 2009

9 by USKurosaki »»
Apr 10, 2013 8:40 PM

» Animated Signatures

koleare - Jan 3, 2013

1 by Rezurrekt »»
Jan 10, 2013 4:13 PM

» List of Free PHP Hosts that meet script requirements

saka - Jun 8, 2010

31 by saka »»
Oct 26, 2012 2:58 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login