Old 09-28-2011, 08:50 AM   #21 (permalink)
Untangle Ninja
 
mrunkel's Avatar
 
Join Date: Jul 2008
Posts: 2,766
mrunkel is on a distinguished road
Default

Quote:
Originally Posted by su_root View Post
I'll take a look at the SQL Ad Block tables when I have time. I'll try to convert Ad Block plus list to .csv and then hopefully a bash script that can import the .csv rules.
Don't waste your time. There is no guarantee that the SQL tables will stay there and/or stay the same. There is ALREADY a method for loading external data into the rules. It's called JSON.

You'd be better off writing a script to format your ad blocker list into proper JSON.
__________________
m.


Big Frickin Disclaimer:
While I'm pretty sure, I can't guarantee that I know what I'm doing. There might be a better way to do this, and this way might actually suck. Make sure you understand the implications of what you're doing before trying to follow these directions.

It often helps troubleshooting if you have a good network map. Look here if you want my advice on how to draw one.
Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
If you need Untangle support please call or email support@untangle.com
mrunkel is offline  
Old 09-28-2011, 09:39 AM   #22 (permalink)
Untangle Ninja

 
WebFooL's Avatar
 
Join Date: Jan 2009
Location: Sweden (Eskilstuna)
URLs submitted: 57
Posts: 3,877
WebFooL is on a distinguished road
Send a message via MSN to WebFooL
Default

i can add so it checks for " in the string and replace it with \" before generating the json output.
Will look at it during the weekend if time allows.
WebFooL is offline  
Old 09-28-2011, 12:03 PM   #23 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Quote:
Originally Posted by mrunkel View Post
There is no "Untangle JSON" format. It's just JSON.

You can't have quotes in there without escaping them. The ] isn't the issue, it's the ".

{"string":"a-kiltojenliitto.fi##TABLE[align=\"center\"]","javaClass":"com.untangle.uvm.node.StringRule"," live":true}

Should work.
Yes, I know it isn't just the ] that is causing problems but when putting ] and " together (or " and ] and ") when it doesn't compute.

Thank You for the tip!
su_root is offline  
Old 09-28-2011, 12:24 PM   #24 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Quote:
Originally Posted by mrunkel View Post
Don't waste your time. There is no guarantee that the SQL tables will stay there and/or stay the same. There is ALREADY a method for loading external data into the rules. It's called JSON.

You'd be better off writing a script to format your ad blocker list into proper JSON.
I waste my time every day when I go to work. Untangle uses Ad Block plus rules, correct? If that is the case, I think it should make more sense to adept to Ad Block rules than the other way around.

No offence but I really don't like the way the Ad Block rules is updated right now. First of all I can't upload the rules as is and secondly update is done manually. I would like to wget the list of choice and convert it to .csv (there is probably a better solution but I'm no coder so I don't know/have the experience) and then import the .csv to the database table.

Also, it would be nice if the Untangle upgrade process would be modular. Let's say I have made changes to the Ad Block module (or OpenVPN) and want to use that in the future so I choose not to update Ad Block module.

I understand that module A can rely on module B and thus this "dream" can be.. just a dream.

Don't get me wrong, I really like Untangle but there is no such thing as a perfect product.
su_root is offline  
Old 09-28-2011, 12:31 PM   #25 (permalink)
Untangle Ninja

 
WebFooL's Avatar
 
Join Date: Jan 2009
Location: Sweden (Eskilstuna)
URLs submitted: 57
Posts: 3,877
WebFooL is on a distinguished road
Send a message via MSN to WebFooL
Default

csv to json
http://www.cparker15.com/utilities/csv-to-json/

you just need to have the csv formatted correctly (you need the header row to be right)
WebFooL is offline  
Old 09-28-2011, 12:34 PM   #26 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Quote:
Originally Posted by WebFooL View Post
csv to json
http://www.cparker15.com/utilities/csv-to-json/

you just need to have the csv formatted correctly (you need the header row to be right)
Thanks, again! Will try it out (soon).
su_root is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 03:44 AM.


© 2010 Untangle, Inc. All Rights Reserved.   SEO by vBSEO 3.6.0 PL2