|AMIP - Advanced mIRC integration plug-in|
This feature still requires some third-party tool like FTP, internal support for this will appear in the future AMIP versions.
I recommend you to use cURL (http://curl.haxx.se/). cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and a busload of other useful tricks.
This manual assumes that you are using cURL, so, go to the page and grab win32 version.
It is recommended to use new AMIP Configurator from http://amip.tools-for.net/config/ since it has special Callbacks/Web presets where you can place commands.
1. Using AMIP to post the playing song information to your page via FTP
First we need to create our HTML page template, I'll take very simple example:
Create a directory, for example, C:\amipweb, create in.html in this directory, copy the above code into in.html. This will be the template. Of course, you can make a damn good page yourself, it's just an example.
Put the downloaded and unpacked curl.exe into the same C:\amipweb directory.
Now let's set up AMIP options: make sure that IRC integration is enabled, actually we are not going to post anything to mIRC, but we need to use a preset. Choose any of the presets, make it active, put the following code in it:
Correct the paths and put in your parameters.
I'll explain the code:
/template command takes the file in the parenthesis (our HTML template file), replaces all the variables, functions, conditional statements, etc and creates the page with song information written in c:\amipweb\out.html file.
/exec command executes the application in the parenthesis and passes all the rest string to this application. So, all the rest lines consists of cURL arguments.
-B tells cURL
that we are transferring ascii file;
If you've done all the things right, on every song change the file will be updated on your FTP and everyone will be able to see what you listening to on your web page.
If you are behind the proxy, it is not the problem! Read cURL manual and add the appropriate parameters to the /exec command in AMIP options.
2. Passing song information to the script (using cURL and PHP)
I think that you've already got the idea after reading the first section. The difference is that we need to pass the variables to the php script.
cURL supports GET and POST methods for passing variables to the scripts.
Here is what you can put to the AMIP's preset (one line):
/exec:(c:\amipweb\curl.exe) -G -d "title=&func_ue(%name)&album=&func_ue(%4)&bitrate=&func_ue(%br)&action=save" http://URL/np.php
Actually, it is very simple:
-G stands for the HTTP GET, remove
it to use HTTP POST method.
-d "title=&func_ue(%name)" -d "album=&func_ue(%4)" -d "bitrate=&func_ue(%br)" -d "action=save"
The last -d parameter will tell our sample script that we need to save this info. If the np.php script is called without any parameters, it will show the last played song info.
Don't forget to specify the URL of the np.php script in the end of /exec command.
Here is the sample np.php script:
If you need to pass a lot of variables, it is not convenient to write a long line in the preset. Instead of this it is possible to use the template with variables, and then pass it to cURL as a configuration file.
Here is the sample cURL config which equals by functionality to our previous cURL /exec call:
# Configuration file for cURL
Save the above code into c:\amipweb\amipweb.conf.
New AMIP preset looks like this:
The /template command parses amipweb.conf, replaces song variables and saves the result in amipweb.out. cURL is executed with -K parameter which tells it to use amipweb.out configuration file.
Using cURL and AMIP you can pass song information anywhere, read cURL manual for additional information.
3. Creating dynamic image signature
You can create dynamic image signatures using AMIPDS (AMIP Dynamic Signature) which can be dowloaded from http://amip.tools-for.net.
Some other links which may help:
http://whatsplaying.sourceforge.net/downloads.shtml (on this page you can find sample perl, php and ASP scripts for whatsplaying plug-in, you can then use them with AMIP).
http://www.thefinn.net/pages.html?page_id=2 (generates dynamic image signature from text, PHP+Font+background)
Two above links are the discussion of different plug-ins and tools which can be used to create dynamic signatures.
http://www.maniacalrage.net/thru.php?ID=18 (sample scripts from the CurrentlyHearing plug-ins).
http://www.dougk-ff7.net/sig.phps (PHP script to create dynamic image signature from the text file).
|AMIP - Advanced mIRC integration plug-in|