Old 09-24-2011, 06:47 AM   #1 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default Import Ad Block lists

Hi,

I'm new to Untangle and I found this post by WebFooL:


WebFooL posted:


Just do a loop and take the value form each line and print out
"
{"string":"$Value","javaClass":"com.untangle.uv m.n ode.StringRule","live":true}
"


I would like to do this but unfortunately I'm really bad at coding and I don't really know where to begin.

Is there anyone who could help me?

Thanks in advance!
su_root is offline  
Old 09-24-2011, 07:52 AM   #2 (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

Hi su_root and welcome to the forum,
What is it that you are trying to do?

I have some "prof of concept" things at http://untangle.nu/gen/


What format do you have on the Ad list?
WebFooL is offline  
Old 09-24-2011, 08:22 AM   #3 (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 did some modifications and now there is a "CSV" import method.

http://untangle.nu/gen/ (click "AD blocker")

Then you can just add ".1100i.com/,*site.com/*,.test.com" etc.
And it will generate a json file that you can import.

my site will generate up to 50 strings for free.
WebFooL is offline  
Old 09-24-2011, 08:30 AM   #4 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Amazing fast reply, thanks!

It's a Ad Block plus format (1.1) and the list is found here (ah, I can't post any links here because I'm still a forum noob):

But if You search on google for easylist.txt or wiltteri.txt, You'll find the lists there.

Thank You Sir once again for Your fast reply!
su_root is offline  
Old 09-24-2011, 08:31 AM   #5 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Quote:
Originally Posted by WebFooL View Post
i did some modifications and now there is a "CSV" import method.


Then you can just add ".1100i.com/,*site.com/*,.test.com" etc.
And it will generate a json file that you can import.

my site will generate up to 50 strings for free.
Amazing! I'll give it a try, thank You once again!
su_root is offline  
Old 09-24-2011, 09:50 AM   #6 (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 did a test with converting the hole file.

but i am getting error on importing it.

I don't know if Untangle can cope with &@| etc.

here is the list in json format
http://untangle.nu/upl/KJH84QN/easylist.json

A dev might take a look at it and see what i did wrong

Last edited by WebFooL; 09-24-2011 at 10:15 AM..
WebFooL is offline  
Old 09-24-2011, 10:30 AM   #7 (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

nothing wrong the file is just to big.

Do any dev know the limit?
WebFooL is offline  
Old 09-24-2011, 11:48 AM   #8 (permalink)
Untanglit
 
Join Date: Sep 2011
Posts: 18
su_root is on a distinguished road
Default

Thanks alot for Your help/work!

If/when this get's sorted out, I'll guess it would be quite easy to get a bash script to update Ad Block list ~once a week?

EDIT: BTW, why does this have to be in the file {"string":"$Value","javaClass":"com.untangle.uv m.n ode.StringRule","live":true}?

Why can't {"string":"","javaClass":"com.untangle.uv m.n ode.StringRule","live":true} be hard coded and only $Value called from a database?

Last edited by su_root; 09-24-2011 at 11:50 AM..
su_root is offline  
Old 09-25-2011, 09:23 AM   #9 (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

the .json format is the way they import/export.

The information is stored in a postgresql.
So if you just find the sql table you can import it directly with normal sql queries.

The test i did was to just import 2200 and that works but when i did a test with about 5500 id did not.
WebFooL is offline  
Old 09-25-2011, 09:25 AM   #10 (permalink)
Untangle Junkie
 
dmorris's Avatar
 
Join Date: Nov 2006
Location: San Mateo, CA
URLs submitted: 10
Posts: 10,611
dmorris is on a distinguished road
Default

I wouldn't bother with any postgres hacks. Settings will be stored in files in JSON format in the future.

I don't know any size limit. Try with firebug loaded and the console open - do you see any errors?
__________________
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

Last edited by dmorris; 09-25-2011 at 09:31 AM..
dmorris 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