Does anyone happen to have a script to import thousands of weblink into Drupal, or any script that imports nodes which can be maybe modified to import weblinks. It will be an awesome help if someone has it and is willing to share.

It will take me a million years to enter thousands of entries I beleive:-(

Regards

KC

Comments

akulkarni’s picture

Hi, i had the same problem of importing tons of links into weblink module and i finally wrote a script which works perfectly :)

My script is in java hence cross platform and it performs a 1 by 1 posting of ur weblinks from a csv files where u have all ur thousands of links

Mail me if u have any issues at proudlyindian at yahoo

So here is the script and steps:

First download a single java class file from http://amitkulkarni.info/download-scripts/AutoPost.class

Make sure u have java installed on ur machine (download from java.sun.com if you don’t have it) mail me if you have problems

Install your weblink module and give permissions to guest for posting weblink

Enable path alias for weblink module

Make taxonomies for ur weblink module; note down the taxonomy number for reference

Make a text file which will have 1 weblink entry on every single line with the following format and information
Title, url, Path Alias, Taxonomy Number, Description
For e.g.
Drupal: Community Plumbing, http://drupal.org/, drupal,1, Best CMS in town

One small tip: Alternatively You can use MS Excel and note all ur info into 5 columns as above (don’t put commas) and then export the file as CSV format and use that CSV file

It is very important that you should have _only_ 4 commas per line in the CSV file else script will fail

Test ur links and comma separated values (CSV file) by running the program this way on ur command line
C:\> java AutoPost http://yoursite.com/cms/node/add/weblink csv-file.txt test

This will check if all ur lines are proper and will check if the url is valid

If it shows error correct ur CSV file

When ur sure all is fine run the same program which will post things to ur weblink module with the change in last keyword in the following way
C:\> java AutoPost http://yoursite.com/cms/node/add/weblink csv-file.txt post

And ur links will be submitted 1 by 1
If you find the there was a problem and the script exited make sure you delete all the successfully submitted links from the CSV file.
Else you can add # in front of the successfully submitted links, # is used as a comment if used at start of the line

After the program exists u can disable the guest permission if you wish
and thats it.

You can type on your command prompt for help
C:\> java AutoPost

Mail me ur problems and comments
Ill be glad to help

kc’s picture

I have not used the program yet. however it sounds like a great way of reducing manual entry. I will give it a try once I have free time.

I do appreciate your taking time and entering all those instructions.

Thanks a bunch.


KC
---

somes’s picture

I had a go but getting an error messages

T minus 3
T minus 2
T minus 1
T minus 0
Connect ....http://www.mysite.com/?q=node/add/weblink

IOException: java .net.NoRouteToHostException: No route to host connect

any suggestions

akulkarni’s picture

Hi there
nice to know some1 is using it ...

btw if ur console literally says that
Connect ....http://www.mysite.com/?q=node/add/weblink

IOException: java .net.NoRouteToHostException: No route to host connect

that means u have to edit the command line and add ur exact site url and not mysite.com which i have marked in bold above

let me know so i can assist furthur

summit’s picture

Hi,

I am testing this -at first look- beautiful program!
But I have problems using it.

My console comes back with: The following URLs had some problems while i was trying to connect. Please check
the url in the browser: []
**** Music is your only friend .... until THE END ****
The url is correct and the guests have weblink adding authorisation.

Can anybody help?
I tried it on drupal 4.6 with all specification and drupal 4.7.

Thanks in advance,
Martijn
www.zon-zee.nl/vakantie

taherk’s picture

So did the error get resolved ? Does this work ?

somes’s picture

havent looked at this in a while but I think the problem was that you had to allow the mysql sever permission to accept your IP address

let us know how you get on