How to get logo from Twitter widget

I use the Twitter widget from Twitter itself. You can download it at http://twitter.com/about/resources/widgets/widget_profile

Now I get this code:

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: 4,
  interval: 6000,
  width: 180,
  height: 320,
  theme: {
    shell: {
      background: '#6e6e6e',
      color: '#ffffff'
    },
    tweets: {
      background: '#fefefe',
      color: '#545454',
      links: '#b05c5c'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: 'all'
  }
}).render().setUser('SchmidtGlobal').start();
</script>

When I embed this on my website, I get my logo in the upper left. Is there any way to get this?

He refers to this script: http://widgets.twimg.com/j/2/widget.js

Any help would be appreciated.

thank

+3
source share
3 answers

The full source here determines the location of the logo:

var logo = isHttps ? 'https://twitter-widgets.s3.amazonaws.com/i/widget-logo.png' : 'http://widgets.twimg.com/i/widget-logo.png';

and embedded in HTML here:

<a target="_blank" href="http://twitter.com"><img alt="" src="' + logo + '"></a>

So, you just have to drop this part, and you're done.

, .


: Twitter, OP, . ( "Test Settings" ) ,

<a class="twtr-profile-img-anchor" href="http://twitter.com/***" target="_blank">
    <img src="http://a1.twimg.com/profile_images/***/***.jpg" class="twtr-profile-img" alt="profile">
</a>

, twtr-profile-img-anchor . , :

/**
  * @public
  * @param {string}
  * sets the profile image source to display in the widget
  * @return self
  */
setProfileImage: function(url) {
  this._profileImage = url;
  this.byClass('twtr-profile-img', 'img').src = isHttps ? url.replace(httpsImageRegex, httpsImageReplace) : url;
  this.byClass('twtr-profile-img-anchor', 'a').href = 'http://twitter.com/' + this.username;
  return this;
}

, , setProfileImage:

this.setProfileImage(resp[0].user.profile_image_url);

, , , . CSS:

.twtr-widget-profile h3, .twtr-widget-profile h4 {
    margin: 0 0 0 40px !important;
}
+6

- CSS. CSS -. css-:

.twtr-hd, .twtr-ft{display: none;}

. , !

+9

find twtr-hd in the script, add

style="display:none"

find twtr-ft in script add

style="display:none"

it should do it.

inspired by Queen of Nerds

+1
source

Source: https://habr.com/ru/post/1774145/


All Articles