Skip to content
Menu
Open World News Open World News
  • Privacy Policy
Open World News Open World News

People’s Party releases party manifesto for LG polls in Karachi

Posted on January 9, 2023 by Michael G

Video by via Dailymotion Source People’s Party releases party manifesto for LG polls in Karachi Go to Source

Switch Kali Linux to Windows in 10 seconds without Virtual Box CodeGrills

Posted on January 9, 2023 by Michael G

Video by via Dailymotion Source Switch Kali Linux to Windows in 10 seconds without Virtual Box | CodeGrills__________________________________________ ▪️Follow us on Social Media▪️ • Instagram:- https://instagram.com/codegrills• Website:- https://codegrills.in• Facebook:- https://facebook.com/codegrills• Twitter:- https://twitter.com/CodeGrills• Telegram channel:- https://t.me/codegrills• GitHub:- https://github.com/codegrills• WhatsApp Group:- https://chat.whatsapp.com/K7IDSIm41R6…__________________________________________ ▪️Contact Us For Any Help And Courses▪️ • Email:- codegrills@gmail.com• WhatsApp:- https://wa.me/+917617707702__________________________________________ ▪️Meet Our Team:-…

West Coast bracing for more flooding rains

Posted on January 9, 2023 by Michael G

Video by via Dailymotion Source Officials are families across California to prepare for the threat of more flooding, power outages and downed trees as atmospheric rivers pound the West Coast. Go to Source

Kumbh Mela Of Art In Bengaluru

Posted on January 9, 2023 by Michael G
Kumbh Mela Of Art In Bengaluru.

Argus News is Odisha’s fastest-growing news channel having its presence on satellite TV and various web platforms. Watch the latest news updates LIVE on matters related to politics, sports, gadgets, business, entertainment, and more. Argus News is setting new standards for journalism through its differentiated programming, philosophy, and tagline ‘Satyara Sandhana’.

To stay updated on-the-go,

Visit Our Official Website: www.argusnews.in
iOS App: http://bit.ly/ArgusNewsiOSApp
Android App: http://bit.ly/ArgusNewsAndroidApp
Live TV: https://argusnews.in/live-tv/
Facebook: https://www.facebook.com/argusnews.in
YouTube: www.youtube.com/c/TheArgusNewsOdia
Twitter: https://twitter.com/ArgusNews_in
Instagram: https://www.instagram.com/argusnewsin

Argus News Is Available on:
TataPlay channel No – 1780
Airtel TV channel No – 609
Dish TV channel No – 1369
d2h channel No – 1757
SITI Networks – 18
Hathway – 732
GTPL KCBPL – 713
& other Leading Cable Networks please visit https://argusnews.in/channel_number for channel number list

You Can WhatsApp Us Your News On- 8480612900
#ArgusNews #ArgusEnglish #Bengaluru #Art #chitrasanthe

Os infiltrados no meio das manifestações – pacífica e democrática dos brasileiros de bem

Posted on January 9, 2023 by Michael G
Os infiltrados no meio das manifestações – pacífica e democrática dos brasileiros de bem

Gintama – Se4 – Ep24 – Are There Still People Who Go to the Ocean and Yell ‘Bakayaro!’ – When a…

Posted on January 9, 2023 by Michael G
Gintama – Se4 – Ep24 – Are There Still People Who Go to the Ocean and Yell ‘Bakayaro!’ – When a Person Is Trapped, Their Inner Door Opens HD Watch Stream English

Specbee: How to Integrate Drupal 9 with Bitly for URL Shortening

Posted on January 9, 2023 by Michael G
How to Integrate Drupal 9 with Bitly for URL Shortening
Admin
09 Jan, 2023

Bit.ly for Drupal provides a rich API that other Drupal modules can use to access Bit.ly functionality. Today’s discussion topic is how we can integrate Bitly with Drupal 9 easily in just a few simple steps.

But first, what are the first three reasons that come to your mind for shortening a URL? Here’s ours–

  • To make more space for content to be posted on micro-blogging sites such as Twitter
  • To mask the original URL 
  • To simply reduce the length of a super-long, ugly URL

Bitly has been our go-to URL-shortening service for a long time, and we love its efficacy and speed. For those of you who haven’t stumbled upon Bitly yet, Bitly is a link management platform that offers products and services on link shortening and more. It allows you to shorten URLs for your websites. 

Specbee: How to Integrate Drupal 9 with Bitly for URL Shortening

Getting Started – Bitly Integration with Drupal 9

Bitly allows for easy integration with your Drupal 9 website. Since there are no stable modules to integrate Bitly in Drupal 9, we will learn about how to call the Bitly API and create forms to integrate it. Here are some steps to get you started with it –

Step 1 – First, you need to create a Bitly account. Go to https://bitly.com/ and create an account. Then you need to login to your Bitly account.

You will then see your Dashboard page.

Bitly Integration with Drupal

 

Step 2 – Next, click on the top-right side of the screen and go to ‘Profile Settings’

Profile settings

Go to Registered OAuth Applications -> Register New App -> Get Registration Code. 

It will send you an email to the mail id you used to sign up.
 

Get Registration with bitly

 

Step 3 – Click on Complete Registration. It will take you back to the Bitly website where you have to add the below details:

complete registration

And Save this OAUTH App. Once saved, the ‘CLIENT ID’ and ‘CLIENT SECRET’ keys will be generated as shown below.

OAUTH APP

Step 4 – Next, go to your browser and enter this Url :
https://bitly.com/oauth/authorize?client_id={YOUR_CLIENT_ID}&redirect_uri={YOUR_WEBSITE-URL}
Once you hit this Url, it will redirect to {YOUR_WEBSITE_URL}?code={YOUR_CODE} . Copy this code and paste it somewhere safe so it’s not lost.

Step 5 – Next, you have to use POSTMAN to call the API or you can also use the CURL command. Learn more about how the Postman tool can help you with API development and API testing.

The method will be POST, Url is api-ssl.bitly.com/oauth/access_token and parameters will be client_id, client_secret, code, redirect_uri.

Bilty API Development

When you hit this API, it will return the following –

access_token=TOKEN&login=BITLY_LOGIN&apiKey=BITLY_API_KEY
access_token – The OAuth access token for specified user
login – The end-user’s Bitly username
apiKey – The application key which will be used
This login and apiKey values should be stored and can be integrate with your Drupal modules.

Implementing the Integration

Now let us learn to create a custom form for integrating your Drupal 9 site with Bitly.

bitlyForm.php
config('bitly.shorten_url');
   $form['configuration'] = [
     '#type' => 'fieldset',
     '#title' => $this->t('Configuration'),
   ];
   $form['configuration']['login_name'] = [
     '#type' => 'textfield',
     '#title' => $this->t('Login Name'),
     '#default_value' => $config->get('login_name'),
     '#required' => TRUE,
   ];
   $form['configuration']['app_key'] = [
     '#type' => 'textfield',
     '#title' => $this->t('Application Key'),
     '#default_value' => $config->get('app_key'),
     '#required' => TRUE,
   ];

   return parent::buildForm($form, $form_state);
 }
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state) {
   $this->config('bitly.shorten_url')
     ->set('login_name', trim($form_state->getValue('login_name')))
     ->set('app_key', trim($form_state->getValue('app_key')))
     ->save();
   parent::submitForm($form, $form_state);
 }
}

Step 7

Add the Login name and Application Key that you have generated and stored previously.

Now, let’s create a function to integrate your Drupal 9 website with Bitly.

/**

* Generate Shorten Url.

*

* @param string $url

*   The url.

* @param string $login

*   The login name.

* @param string $appKey

*   The api key.

*

* @return string

*   Returns bitly url.

*/

public static function makeBitlyUrl($url, $login, $appKey) {

 // Create the URL.

 $bitly = ‘http://api.bit.ly/shorten?version=2.0.1&longUrl=’. urlencode($url) . '&login=' . $login . '&apiKey=' . $appKey . '&format=xml';

 // Get the url

 // could also use cURL here.

 $response = file_get_contents($bitly);

 // Xml.

 $xml = simplexml_load_string($response);

 return 'https://bit.ly/' . $xml->results->nodeKeyVal->hash;

Let’s now call the makeBitlyUrl function to generate the Bitly Url.

$config = Drupal::config(‘bitly.shorten_url');

$bitlyUrl = (string) makeBitlyUrl('https://www.example.com', $config->get('login_name'), $config->get('app_key'));

You will now get the integrated Bitly Url in the $bitlyUrl variable.

Found this article useful? Here’s a really tiny URL of this article for you to copy, embed, or share:
<!–

<!–

<!–

//–>

//–>

//–>

bit.ly/3CySc1v

Click to copy URL to your clipboard

Bitly is a great tool for shortening URLs in a jiffy. We hope this article on integrating Bitly with Drupal 9 proves helpful and you come back to us for more such interesting and resourceful articles. Specbee offers expert Drupal development services to help create compelling websites leveraging the best of Drupal. Contact us to know how we can help.

Drupal 9
Drupal 9 Module
Drupal Development
Drupal Planet

 

Recent Blogs

Image
Drupal with Bitly teaser

How to Integrate Drupal 9 with Bitly for URL Shortening

Image
Lando Setup

How To Accelerate Drupal Development with Lando

Image
D10 Interviewteaser

Everything you wanted to know about Drupal 10 – Q&A with Experts

Want to extract the maximum out of Drupal?
TALK TO US

Featured Success Stories


Physician Insurance

Upgrading and consolidating multiple web properties to offer a coherent digital experience for Physicians Insurance


IEEE Itsoc thumbnail

Upgrading the web presence of IEEE Information Theory Society, the most trusted voice for advanced technology


Great Southern Homes

Great Southern Homes, one of the fastest growing home builders in the United States, sees greater results with Drupal 9

View all Case Studies

Awesome Ruby blogs

Posted on January 9, 2023 by Michael G
Hello everyone! 👋
I’m happy to share with you an updated list of ruby and rails blogs.

Sidi Mahdy Amine delivers a Khutbah giving spiritual insights. – More Sidi Mahdy: https…

Posted on January 8, 2023 by Michael G

Video by via Dailymotion Source Sidi Mahdy Amine delivers a Khutbah giving spiritual insights. – More Sidi Mahdy: https://mcceastbay.org/mahdy This sermon was delivered at the Muslim Community Center – East Bay (MCC East Bay) in Pleasanton, California on Friday, January 6, 2023. Mahdy Amine is a Zaytuna College alumnus and practicing attorney. He also teaches…

How to use check box in Google sheets

Posted on January 8, 2023 by Michael G

Video by via Dailymotion Source Accurate long-term attendance records are often needed to calculate leave, entitlements and other metrics. But counting the days is a sensitive task. Using check boxes in Google Sheets can help you keep track of items or events. To use a check box, first select the cell where you want it…

  • Previous
  • 1
  • …
  • 1,245
  • 1,246
  • 1,247
  • 1,248
  • 1,249
  • 1,250
  • 1,251
  • …
  • 1,531
  • Next

Recent Posts

  • [TUT] LoRa & LoRaWAN – MikroTik wAP LR8 kit mit The Things Network verbinden [4K | DE]
  • Mercado aguarda Powell e olha Trump, dados e Haddad | MINUTO TOURO DE OURO – 11/02/25
  • Dan Levy Gets Candid About Learning How To Act Differently After Schitt’s Creek: ‘It’s Physically…
  • Building a Rock Shelter & Overnight Stay in Heavy Snow 🏕️⛰️
  • Les milliardaires Elon Musk et Xavier Niel s’insultent copieusement

Categories

  • Android
  • Linux
  • News
  • Open Source
©2025 Open World News | Powered by Superb Themes
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT