[arch-projects] json-rpc for aur (experimental)
In my working branch today, I got a json remote package search working. It might be a little rough, so check it out if you are brave. Currently in my 'testing' branch. I have some test code here: http://www.archlinux.org/~eliott/zomgstuff/rpc_examples.tar.gz An example in python, as well as an example in html/javascript (using jQuery). For testing, make sure you configure the target url manually in the respective python or html file(s). The python version is VERY SIMPLE. Just edit the file and run. A more robust test harness could probably be written with the python one...that takes some command line args and such. Anyway..my hope is this may be useful for some of the people that have command line tools. JSON is alot easier to parse than scraping the html output....
oh. Forgot to mention. For mysql fulltext searching, I had to add a fulltext index. <code> ALTER TABLE Packages ADD FULLTEXT (Name,Description); REPAIR TABLE Packages QUICK; </code>
What you're saying here is beyond my understanding I thnk. So this allows a remote program to call a PHP function and receive data without searching through the HTML or something? I was thinking XML could be used eventually, it shouldn't be too hard to parse and can be styled for the webpage, so a 2-in-1 kind of format.
eliott wrote:
oh. Forgot to mention. For mysql fulltext searching, I had to add a fulltext index.
<code> ALTER TABLE Packages ADD FULLTEXT (Name,Description); REPAIR TABLE Packages QUICK; </code>
Be sure to update the support/schema/aur-schema.sql file. It's generally best to include those changes in the commit that requires them, so that when I go to deploy, I can diff the changes to the schema and make sure any necessary changes have been made before deploying. This sounds like a great idea! We'd been talking about some sort of RPC layer for AUR2 but never got anywhere with it. - P
Be sure to update the support/schema/aur-schema.sql file. It's generally best to include those changes in the commit that requires them, so that when I go to deploy, I can diff the changes to the schema and make sure any necessary changes have been made before deploying.
Sure thing Paul. I amended the commit on my testing branch, so that it includes the schema update in it too now. Will be easier to cherry the entire rpc stuff this way. As a side effect, you may need to do the -f force fetch to overwrite your local pull of my testing repo.
participants (3)
-
eliott
-
Loui
-
Paul Mattal