The week-long WorldPride festival is under way in Toronto, with a special Twitter-powered Pride flag unveiled as part of the festivities.

A flag on the roof of Toronto pub The Churchmouse has gained attention, as it will raise and lower in response to positive and negative tweets.

Co-creator Patrick Schroen told the Toronto Star: “Homophobic slurs and stuff that we want to stop moves it down.

“If anyone says something positive using positive keywords, including LGBT, pride, gay pride, stuff like that – as well as our hashtag [#RaiseThePride] – then the flag moves up.”

A virtual version of the flag can be seen at RaiseThePride.Ca.

Praising the project, Anne Creighton, the president of Toronto PFLAG, said: “It used to be that if you said racist things, people accepted it. Now if you say a racist thing, people get fired.

“We need to get there with homophobic language. It needs to be understood that it’s simply not acceptable, because those words have power.”

The event, which will run from June 20 until June 29, includes the WorldPride Human Rights Conference, which will be attended by representatives from over 40 countries across the globe.

Ten Ugandan activists due to speak at the event were denied entry to Canada earlier this year, over fears they would claim asylum, but after intervention from senior ministers, the group were granted temporary travel visas.

A mass wedding for up to 200 LGBT couples is expected to take place at Casa Loma, one of Canada’s only castles, on Thursday.

Opening the festival on Friday, Deputy Mayor Norm Kelly said: “Toronto has a long and proud tradition of advocating for LGBT human rights.

“From the 1973 inclusion of sexual orientation in our Human Rights Anti-Harassment/Discrimination Policy to being Canada’s first city to host a same-sex wedding, Toronto has led by example.

“We can all be extremely proud that Toronto is hosting an international event of this calibre.”

Kevin Beaulieu, executive director of Pride Toronto, added: “Pride is a celebration. Everyone knows about the parade, it being one of Canada’s largest arts and culture festivals.

“But it’s also part of a global movement that celebrates and builds LGBT human rights. It’s a celebration grounded in human rights. It’s a party with a purpose.”