NamePros
NamePros is a free community for domain name owners, buyers and website developers.

Once registered, you can:
  • Post your domains for sale or for free appraisals.
  • Private message and conduct business with other domain owners and webmasters.
  • View member-only forum areas such as 'Legal Issues' and 'Expired Domains' (NOT visible to Google, Yahoo or any search engines.)
  • Free access to our searchable archives spanning 7 years and over 2 million forum posts.
Create an account now or login using your Facebook account.


Go Back   NamePros.com > Discussion Forums > Web Design & Development > Programming > CODE
New! Use your Facebook, Google, AIM & Yahoo accounts to securely log into this site, click logo to login  

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.



Closed Thread
 
LinkBack Thread Tools
Old 09-09-2007, 10:46 AM THREAD STARTER               #1 (permalink)
DNMedia.com
 
Michael's Avatar
Join Date: Jul 2007
Location: Maryland
Posts: 1,872
1,249.50 NP$ (Donate)

Michael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond repute
 


Breast Cancer Cancer Survivorship Myanmar Relief Parkinson's Disease Child Abuse Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
PHP Function to Submit Site to Del.icio.us

Please Note:
1. $site must start with http://
2. $tags must be separated with spaces, not commas
3. $proxy_addy must start with http://
4. $use_proxy must be passed in as TRUE if you want to use a proxy
5. Make sure you have CURL installed.

I wrote this and I am giving you guys permission to use it however you want commercial or otherwise, just don't sell the code itself. Have fun!

Demo using this function can be found at BMBot.com.

rep appreciated

PHP Code:
<?php

function delicious_submit($user$pass$site$note$desc$tags$proxy_addy$proxy_port$use_proxy FALSE)
{
    
// Set curl options.
    
$user_agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
    
$ch curl_init();
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_SSL_VERIFYHOST2);
    
curl_setopt($chCURLOPT_USERAGENT$user_agent);
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_COOKIEJARdirname(__FILE__).'/cookie.txt');
    
curl_setopt($chCURLOPT_COOKIEFILEdirname(__FILE__).'/cookie.txt');
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    if(
$use_proxy){
        
curl_setopt($chCURLOPT_HTTPPROXYTUNNEL1);
        
curl_setopt($chCURLOPT_PROXY$proxy_addy);
        
curl_setopt($chCURLOPT_PROXYPORT$proxy_port);
    }

    
// Visit login page.
    
$url 'https://secure.del.icio.us/login';
    
$params '';
    
curl_setopt($chCURLOPT_POSTFIELDS$params);
    
curl_setopt($chCURLOPT_URL$url);
    
$result curl_exec($ch);
    
    
//Grab unique token.
    
$piece strstr($result"inkey\"");
    
$piece strstr($piece"value=\"");
    
$token substr($piece732);

    
// Log in with token, user and pass.    
    
$url 'https://secure.del.icio.us/login';
    
$params 'inkey=' $token '&user_name=' $user '&password=' $pass '&login=log%20in';    
    
curl_setopt($chCURLOPT_POSTFIELDS$params);
    
curl_setopt($chCURLOPT_URL$url);    
    
$result curl_exec($ch);    

    
// Submit the url.
    
$url 'http://del.icio.us/' $user '?url=' $site '&submit=save&jump=no';
    
curl_setopt($chCURLOPT_HTTPGET1);
    
curl_setopt($chCURLOPT_URL$url);
    
$result curl_exec($ch);

    
// Grab the new token.
    
$piece strstr($result"key\"");
    
$piece strstr($piece"value=\"");
    
$token substr($piece732);

    
// Grab the unique key code.
    
$piece strstr($result$user "?");
    
$piece substr($piecestrlen($user));
    
$piece strstr($piece$user "?");
    
$quote strpos($piece"\"");
    
$len strlen($user);
    
$code substr($piece$len 1$quote $len 1);

    
// Submit the url, description, notes, and tags along with the new token and key code.
    
$url 'http://del.icio.us/' $user '?' $code;
    
$params 'url=' $site '&oldurl=' $site '&description=' $desc '&notes=' $note '&tags=' $tags '&jump=no&key=' $token;
    
curl_setopt($chCURLOPT_POST1);
    
curl_setopt($chCURLOPT_POSTFIELDS$params);
    
curl_setopt($chCURL_OPT_URL$url);
    
$result curl_exec($ch);

    
curl_close($ch);
}

?>

Last edited by idevlabs; 09-09-2007 at 11:24 AM.
Michael is offline  
Old 09-09-2007, 10:52 AM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
13.51 NP$ (Donate)

Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 
Send a message via MSN to Daniel


Ethan Allen Fund Ethan Allen Fund
Very nice, reputation left. I was thinking of writing one of these.
Daniel is offline  
Old 09-12-2007, 12:13 AM   #3 (permalink)
New Member
Join Date: Mar 2006
Posts: 3
6.50 NP$ (Donate)

seohyderabad is an unknown quantity at this point
 



hi

How to install this & how can i use 2 or three accounts at once
seohyderabad is offline  
Old 09-12-2007, 05:39 AM THREAD STARTER               #4 (permalink)
DNMedia.com
 
Michael's Avatar
Join Date: Jul 2007
Location: Maryland
Posts: 1,872
1,249.50 NP$ (Donate)

Michael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond reputeMichael has a reputation beyond repute
 


Breast Cancer Cancer Survivorship Myanmar Relief Parkinson's Disease Child Abuse Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
If by asking how to install it you're asking me to give you the rest of the code to have a working site, sorry... I'm not that generous

This is the hard part. If you need help making an html form and using a while loop you're best bet is www.Codewalkers.com or reading the manual.
Michael is offline  
Old 09-18-2007, 05:55 AM   #5 (permalink)
The original NP Emo Kid
 
liam_d's Avatar
Join Date: Jan 2005
Location: Plymouth, UK
Posts: 1,689
0.00 NP$ (Donate)

liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
 
My Twitter

Send a message via MSN to liam_d



Brilliant! Think i will use this for sure!!
liam_d is offline  
Old 09-18-2007, 10:26 AM   #6 (permalink)
Senior Member
 
Porte's Avatar
Join Date: May 2005
Location: I'm right here
Posts: 3,528
21.30 NP$ (Donate)

Porte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud of
 



Thanks for your precious code, rep left.
Porte is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



Quick Cash Domaining

Quick Cash Domaining



Advertise on NamePros
All times are GMT -7. The time now is 06:33 PM.

Contact Us - NamePros.com - Privacy Statement - Top
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2   Ad Management plugin by RedTyger